aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.tests
diff options
context:
space:
mode:
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.tests')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/.classpath24
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/.project29
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs98
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/MODULE_LICENSE_EPL0
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/NOTICE224
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/README.txt101
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/build.properties17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class1.java35
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class2.java21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/pom.xml17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/prefs.template3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptParserTest.java200
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java289
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java990
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategyTest.java473
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlCharacterMatcherTest.java144
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java320
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java978
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java109
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java495
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java136
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java170
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java232
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java128
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java334
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java58
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java114
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml27
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt67
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt67
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt156
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt23
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt96
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt156
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml23
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt68
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt317
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff34
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff31
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff32
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff32
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff32
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff33
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff33
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff31
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff33
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt29
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt76
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt89
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml28
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff29
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml27
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml73
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml74
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml83
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml35
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml35
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml28
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml92
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml75
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff84
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml61
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml75
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml70
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml62
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml67
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml38
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml26
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml70
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml51
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml37
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff69
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff85
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml40
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml37
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml39
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml26
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java424
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/launch/JUnitLaunchConfigDelegateTest.java114
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java218
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java293
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java757
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java402
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java128
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/exportgradle/ExportGradleTest.java303
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java901
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java135
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AllTests.java40
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/EclipseTestCollector.java121
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java48
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java117
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/UnitTests.java61
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java328
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/AndroidManifestWriter.java131
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java263
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/test.xml76
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittest.xml54
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/PointTest.java123
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java301
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java77
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java245
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseViewRuleTest.java42
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java63
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GravityHelperTest.java127
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GridLayoutRuleTest.java23
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java375
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java466
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java167
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java61
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java81
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestColor.java36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java158
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java181
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java477
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java50
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/grid/GridModelTest.java852
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/relative/DeletionHandlerTest.java445
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java382
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserManifestTest.java94
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserTest.java120
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtPluginTest.java49
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtUtilsTest.java127
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/build/BaseBuilderTest.java37
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java71
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtilsTest.java297
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/GraphicsUtilitiesTest.java313
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/NinePatchedImageTest.java914
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java335
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/ExplodeRenderingHelperTest.java256
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java256
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java143
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManagerTest.java185
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleTest.java99
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfoTest.java797
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ControlPointTest.java73
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilitiesTest.java206
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java368
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java128
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeOverlayTest.java75
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutPointTest.java64
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PointTestCases.java107
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLoggerTest.java82
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManagerTest.java120
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttributeTest.java109
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElementTest.java343
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SwtUtilsTest.java343
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/MockNodeProxy.java68
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeFactoryTest.java123
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngineTest.java37
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepositoryTest.java77
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleterTest.java151
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiElementNodeTest.java284
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java112
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java62
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java319
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java297
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/ProjectHelperTest.java66
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java135
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java160
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java110
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java183
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidatorTest.java101
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContextTest.java22
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java166
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java182
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmActivityToLayoutMethodTest.java50
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmCamelCaseToUnderscoreMethodTest.java58
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmClassNameToResourceMethodTest.java66
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlAttributeMethodTest.java50
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethodTest.java66
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlTextMethodTest.java46
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmExtractLettersMethodTest.java46
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmLayoutToActivityMethodTest.java54
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmSlashedPackageNameMethodTest.java50
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmUnderscoreToCamelCaseMethodTest.java58
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java189
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java54
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-one-dot.9.pngbin206 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-two-dots.9.pngbin214 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area.9.pngbin210 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched1.9.pngbin2923 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched2.9.pngbin2913 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched3.9.pngbin2914 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched4.9.pngbin2914 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched5.9.pngbin2929 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched6.9.pngbin2920 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched7.9.pngbin2916 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched8.9.pngbin2923 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/layout-bounds-only.9.pngbin1466 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched-interlace.pngbin3138 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched.pngbin2906 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched-with-badpatches.9.pngbin214 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched1.9.pngbin210 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched2.9.pngbin217 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched3.9.pngbin214 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jarbin1829 -> 0 bytes
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml340
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_manifest_attrs.xml180
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/View.java21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/ViewGroup.java29
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/LinearLayout.java27
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/TableLayout.java27
478 files changed, 0 insertions, 31002 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
deleted file mode 100644
index f76017492..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="unittests"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
- <classpathentry kind="lib" path="libs/kxml2-2.3.0.jar"/>
- <classpathentry kind="lib" path="libs/easymock.jar"/>
- <classpathentry kind="lib" path="libs/testutils.jar"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/ninepatch.jar" sourcepath="/ninepatch"/>
- <classpathentry kind="lib" path="/plugin-base/libs/sdklib.jar" sourcepath="/SdkLib"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/sdkuilib.jar" sourcepath="/SdkUiLib"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/rule-api.jar" sourcepath="/rule-api"/>
- <classpathentry kind="lib" path="/plugin-base/libs/common.jar" sourcepath="/common"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/lint-api.jar" sourcepath="/lint-api"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/lint-checks.jar" sourcepath="/lint-checks"/>
- <classpathentry kind="lib" path="/plugin-base/libs/sdk-common.jar"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/lombok-ast-0.2.2.jar"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/asm-5.0.3.jar"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/asm-analysis-5.0.3.jar"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/asm-tree-5.0.3.jar"/>
- <classpathentry kind="lib" path="/plugin-adt/libs/manifest-merger.jar" sourcepath="/manifest-merger"/>
-</classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.project b/eclipse/plugins/com.android.ide.eclipse.tests/.project
deleted file mode 100644
index d37e27b11..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>plugin-tests</name>
- <comment></comment>
- <projects>
- <project>SdkLib</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ea661960a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
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
deleted file mode 100644
index 8289d64ed..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Android Plugin Tests
-Bundle-SymbolicName: com.android.ide.eclipse.tests
-Bundle-Version: 24.3.3.qualifier
-Bundle-Vendor: The Android Open Source Project
-Fragment-Host: com.android.ide.eclipse.adt;bundle-version="21.0.0"
-Require-Bundle: org.junit
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ClassPath: .,
- libs/kxml2-2.3.0.jar,
- libs/testutils.jar,
- libs/lint-api.jar,
- libs/lint-checks.jar,
- libs/easymock.jar
-Import-Package: com.android.tools.lint.detector.api
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/MODULE_LICENSE_EPL b/eclipse/plugins/com.android.ide.eclipse.tests/MODULE_LICENSE_EPL
deleted file mode 100644
index e69de29bb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/MODULE_LICENSE_EPL
+++ /dev/null
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/NOTICE b/eclipse/plugins/com.android.ide.eclipse.tests/NOTICE
deleted file mode 100644
index 49c101df7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/NOTICE
+++ /dev/null
@@ -1,224 +0,0 @@
-*Eclipse Public License - v 1.0*
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-*1. DEFINITIONS*
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and
-documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and
-are distributed by that particular Contributor. A Contribution
-'originates' from a Contributor if it was added to the Program by such
-Contributor itself or anyone acting on such Contributor's behalf.
-Contributions do not include additions to the Program which: (i) are
-separate modules of software distributed in conjunction with the Program
-under their own license agreement, and (ii) are not derivative works of
-the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor which
-are necessarily infringed by the use or sale of its Contribution alone
-or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this
-Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement,
-including all Contributors.
-
-*2. GRANT OF RIGHTS*
-
-a) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free copyright
-license to reproduce, prepare derivative works of, publicly display,
-publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and
-object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free patent license
-under Licensed Patents to make, use, sell, offer to sell, import and
-otherwise transfer the Contribution of such Contributor, if any, in
-source code and object code form. This patent license shall apply to the
-combination of the Contribution and the Program if, at the time the
-Contribution is added by the Contributor, such addition of the
-Contribution causes such combination to be covered by the Licensed
-Patents. The patent license shall not apply to any other combinations
-which include the Contribution. No hardware per se is licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the
-licenses to its Contributions set forth herein, no assurances are
-provided by any Contributor that the Program does not infringe the
-patent or other intellectual property rights of any other entity. Each
-Contributor disclaims any liability to Recipient for claims brought by
-any other entity based on infringement of intellectual property rights
-or otherwise. As a condition to exercising the rights and licenses
-granted hereunder, each Recipient hereby assumes sole responsibility to
-secure any other intellectual property rights needed, if any. For
-example, if a third party patent license is required to allow Recipient
-to distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient
-copyright rights in its Contribution, if any, to grant the copyright
-license set forth in this Agreement.
-
-*3. REQUIREMENTS*
-
-A Contributor may choose to distribute the Program in object code form
-under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties
-and conditions, express and implied, including warranties or conditions
-of title and non-infringement, and implied warranties or conditions of
-merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability for
-damages, including direct, indirect, special, incidental and
-consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are
-offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such
-Contributor, and informs licensees how to obtain it in a reasonable
-manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-
-*4. COMMERCIAL DISTRIBUTION*
-
-Commercial distributors of software may accept certain responsibilities
-with respect to end users, business partners and the like. While this
-license is intended to facilitate the commercial use of the Program, the
-Contributor who includes the Program in a commercial product offering
-should do so in a manner which does not create potential liability for
-other Contributors. Therefore, if a Contributor includes the Program in
-a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified
-Contributor to the extent caused by the acts or omissions of such
-Commercial Contributor in connection with its distribution of the
-Program in a commercial product offering. The obligations in this
-section do not apply to any claims or Losses relating to any actual or
-alleged intellectual property infringement. In order to qualify, an
-Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial
-Contributor to control, and cooperate with the Commercial Contributor
-in, the defense and any related settlement negotiations. The Indemnified
-Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.
-
-*5. NO WARRANTY*
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
-ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES
-OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
-A PARTICULAR PURPOSE. Each Recipient is solely responsible for
-determining the appropriateness of using and distributing the Program
-and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program
-errors, compliance with applicable laws, damage to or loss of data,
-programs or equipment, and unavailability or interruption of operations.
-
-*6. DISCLAIMER OF LIABILITY*
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-*7. GENERAL*
-
-If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further action
-by the parties hereto, such provision shall be reformed to the minimum
-extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including
-a cross-claim or counterclaim in a lawsuit) alleging that the Program
-itself (excluding combinations of the Program with other software or
-hardware) infringes such Recipient's patent(s), then such Recipient's
-rights granted under Section 2(b) shall terminate as of the date such
-litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails
-to comply with any of the material terms or conditions of this Agreement
-and does not cure such failure in a reasonable period of time after
-becoming aware of such noncompliance. If all Recipient's rights under
-this Agreement terminate, Recipient agrees to cease use and distribution
-of the Program as soon as reasonably practicable. However, Recipient's
-obligations under this Agreement and any licenses granted by Recipient
-relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted and may
-only be modified in the following manner. The Agreement Steward reserves
-the right to publish new versions (including revisions) of this
-Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the
-initial Agreement Steward. The Eclipse Foundation may assign the
-responsibility to serve as the Agreement Steward to a suitable separate
-entity. Each new version of the Agreement will be given a distinguishing
-version number. The Program (including Contributions) may always be
-distributed subject to the version of the Agreement under which it was
-received. In addition, after a new version of the Agreement is
-published, Contributor may elect to distribute the Program (including
-its Contributions) under the new version. Except as expressly stated in
-Sections 2(a) and 2(b) above, Recipient receives no rights or licenses
-to the intellectual property of any Contributor under this Agreement,
-whether expressly, by implication, estoppel or otherwise. All rights in
-the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the
-intellectual property laws of the United States of America. No party to
-this Agreement will bring a legal action under this Agreement more than
-one year after the cause of action arose. Each party waives its rights
-to a jury trial in any resulting litigation.
-
-
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/README.txt b/eclipse/plugins/com.android.ide.eclipse.tests/README.txt
deleted file mode 100644
index fe69958d3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/README.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-This project contains the tests for the Android Eclipse Plugins.
-
-You can do three things:
-1- Run the unit tests as a full "eclipse plugin" suite
-2- Run the unit tests as independent JUnit tests (not as plugin)
-3. Run the functional tests as a full "eclipse plugin" suite (require a real SDK)
-
-The unit tests are isolated tests that do not require external dependencies such as an SDK.
-The functional tests are higher level tests that may require a real SDK.
-
-------------------------------------------
-1- Running the unit tests as a full "eclipse plugin" suite
-------------------------------------------
-
-Steps to run the test suite:
-
-A- In Eclipse, import following projects from development/tools/eclipse/plugins:
- - adt-tests
- - adt
- - ddms
-
-B- Create a new "JUnit Plug-in Test" run configuration via the "Run > Open Run Dialog..." menu
-Set the launch configuration's data as follows:
-i. "Test" tab:
- Select "Run a single test"
- Project: adt-tests
- Test class: com.android.ide.eclipse.tests.UnitTests
- Test runner: JUnit 3
-ii. "Arguments" tab:
- Set "VM Arguments" to
-"-Dtest_data=<adt>/plugins/com.android.ide.eclipse.tests/unittests/data/"
-replacing "<adt>" with absolute filesystem path to the android plugin source location
-
-All other fields can be left with their default values
-
-C. Run the newly created launch configuration
-
-Running the tests will run a secondary instance of Eclipse.
-
-Please note the following constraints to be aware of when writing tests to run within a plugin environment:
-
-a. Access restrictions: cannot access package or protected members in a different
-plugin, even if they are in the same declared package
-b. Using classloader.getResource or getResourceAsStream to access test data will
-likely fail in the plugin environment. Instead, use AdtTestData to access test files
-in conjunction with the "test_data" environment variable mentioned above
-
-
--------------------------------------------
-2- Run the unit tests as independent JUnit tests (not plugin)
--------------------------------------------
-
-A- In Eclipse, import following projects from development/tools/eclipse/plugins:
- - adt-tests
- - adt
- - ddms
-
-B- Select the "unittests" source folder, right-click and select
- "Run As > JUnit Test" (i.e. not the plugin tests)
-
-This creates a debug configuration of type "JUnit Test" running all tests
-in the source folder "unittests". The runtime must be JUnit 3.
-
-Note: this method runs the tests within a regular JVM environment (ie not within
-an Eclipse instance). This method has the advantage of being quicker than running
-as a JUnit plugin test, and requires less potential set-up, but has the
-disadvantage of not properly replicating how the tests will be run in the
-continuous test environment. Tests that pass when run as "JUnit Tests" can
-fail when run as "JUnit Plugin Tests", due to the extra constraints imposed by
-running within an Eclipse plug-in noted in section 1.
-
-------------------------------------------
-3- Running the functional tests as a full "eclipse plugin" suite
-------------------------------------------
-
-Steps to run the test suite:
-
-A- In Eclipse, import following projects from development/tools/eclipse/plugins:
- - adt-tests
- - adt
- - ddms
-
-B - Setup an SDK on host machine, that is compatible with the Eclipse ADT plugins under test
-
-C- Create a new "JUnit Plug-in Test" run configuration via the "Run > Open Run Dialog..." menu
-Set the launch configuration's data as follows:
-i. "Test" tab:
- Select "Run a single test"
- Project: adt-tests
- Test class: com.android.ide.eclipse.tests.FuncTests
- Test runner: JUnit 3
-ii. "Environment" tab:
- Add a "sdk_home" environment variable, setting its path to the SDK from step B
-
-All other fields can be left with their default values
-
-D. Run the newly created launch configuration
-
-Running the tests will run a secondary instance of Eclipse.
-
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/build.properties b/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
deleted file mode 100644
index 2a82227c5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-source.. = src/,\
- unittests/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- test.xml,\
- prefs.template,\
- unittest.xml,\
- kxml2-2.3.0.jar,\
- testutils.jar,\
- layoutlib.jar,\
- lint-api.jar,\
- lint-checks.jar,\
- unittests/com/android/sdklib/testdata/,\
- unittests/com/android/layoutlib/testdata/,\
- unittests/com/android/ide/eclipse/testdata/,\
- easymock.jar
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class1.java b/eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class1.java
deleted file mode 100644
index 3cf102733..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2007 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 jar.example;
-
-public class Class1 {
-
- public static final int sStaticField = 1;
-
- /** constructor */
- public Class1() {
- int a = 1;
- }
-
- public static class InnerStaticClass1 {
-
- }
-
- public class InnerClass2 {
-
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class2.java b/eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class2.java
deleted file mode 100644
index 4d15c4772..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/not_source_folder/jar/example/Class2.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2007 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 jar.example;
-
-public class Class2 extends Class1 {
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/pom.xml b/eclipse/plugins/com.android.ide.eclipse.tests/pom.xml
deleted file mode 100644
index 71bbad8f4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <version>24.3.3-SNAPSHOT</version>
- <artifactId>com.android.ide.eclipse.tests</artifactId>
- <packaging>eclipse-test-plugin</packaging>
- <name>tests</name>
-
- <parent>
- <relativePath>../../pom.xml</relativePath>
- <groupId>adt.group</groupId>
- <artifactId>parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
-</project>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/prefs.template b/eclipse/plugins/com.android.ide.eclipse.tests/prefs.template
deleted file mode 100644
index e0037decc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/prefs.template
+++ /dev/null
@@ -1,3 +0,0 @@
-#Wed Feb 20 16:56:40 PST 2008
-com.android.ide.eclipse.adt.sdk=sdk_home
-eclipse.preferences.version=1
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptParserTest.java
deleted file mode 100644
index af4e2b7c5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptParserTest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (C) 2011 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.build;
-
-import com.android.ide.eclipse.adt.AdtConstants;
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
-
-public class AaptParserTest extends AdtProjectTest {
-
- public void testBasic() throws Exception {
- // Test the "at 'property' with value 'value' range matching included with most aapt errors
- checkRanges("quickfix1.xml", "res/layout/quickfix1.xml",
- "quickfix1.xml:7: error: Error: No resource found that matches the given name (at"
- + " 'text' with value '@string/firststring').",
- "android:text=\"^@string/firststring\"",
- "android:text=\"@string/firststring^\"");
- }
-
- public void testRange1() throws Exception {
- // Check that when the actual aapt error occurs on a line later than the original error
- // line, the forward search which looks for a value match does not stop on an
- // earlier line that happens to have the same value prefix
- checkRanges("aapterror1.xml", "res/layout/aapterror1.xml",
- "aapterror1.xml:5: error: Error: Integer types not allowed (at "
- + "'layout_marginBottom' with value '50').",
- "marginBottom=\"^50\"", "marginBottom=\"50^\"");
- }
-
- public void testRange2() throws Exception {
- // Check that when we have a duplicate resource error, we highlight both the original
- // property and the original definition.
- // This tests the second, duplicate declaration ration.
- checkRanges("aapterror2.xml", "res/values/aapterror2.xml",
- "aapterror2.xml:7: error: Resource entry repeatedStyle1 already has bag item "
- + "android:gravity.",
- "<item name=\"^android:gravity\">bottom</item>",
- "<item name=\"android:gravity^\">bottom</item>");
- }
-
- public void testRange3() throws Exception {
- // Check that when we have a duplicate resource error, we highlight both the original
- // property and the original definition.
- // This tests the original definition. Note that we don't have enough position info
- // so we simply highlight the whitespace portion of the line.
- checkRanges("aapterror2.xml", "res/values/aapterror2.xml",
- "aapterror2.xml:4: Originally defined here.",
- "^<item name=\"android:gravity\">left</item>",
- "<item name=\"android:gravity\">left</item>^");
- }
-
- public void testRange4() throws Exception {
- // Check for aapt error which occurs when the attribute name in an item style declaration
- // is nonexistent
- checkRanges("aapterror3.xml", "res/values/aapterror3.xml",
- "aapterror3.xml:4: error: Error: No resource found that matches the given name: "
- + "attr 'nonexistent'.",
- "<item name=\"^nonexistent\">5</item>",
- "<item name=\"nonexistent^\">5</item>");
- }
-
- public void testRange5() throws Exception {
- // Test missing resource name
- checkRanges("aapterror4.xml", "res/values/aapterror4.xml",
- "aapterror4.xml:3: error: A 'name' attribute is required for <style>",
- "<^style>",
- "<style^>");
- }
-
- public void testRange6() throws Exception {
- checkRanges("aapterror4.xml", "res/values/aapterror4.xml",
- "aapterror4.xml:6: error: A 'type' attribute is required for <item>",
- "<^item></item>",
- "<item^></item>");
- }
-
- public void testRange7() throws Exception {
- // Test missing resource name
- checkRanges("aapterror4.xml", "res/values/aapterror4.xml",
- "aapterror4.xml:6: error: A 'name' attribute is required for <item>",
- "<^item></item>",
- "<item^></item>");
- }
-
- // This test is disabled because I can't find a useful scenario for handling this error
- // message. When this error occurs, we will also get a warning on a missing attribute, and
- // that warning already underlines the element name.
- //public void testRange8() throws Exception {
- // // Test missing resource name
- // checkRanges("aapterror4.xml", "res/values/aapterror4.xml",
- // "aapterror4.xml:4: error: Error: Resource id cannot be an empty string: attr ''.",
- // " ^<item />",
- // " <item />^");
- //}
-
- public void testRange9() throws Exception {
- // Test missing resource name
- checkRanges("aapterror5.xml", "res/values/aapterror5.xml",
- "aapterror5.xml:4: error: Error: String types not allowed (at "
- + "'android:layout_width' with value '').",
- " <item name=\"^android:layout_width\"></item>",
- " <item name=\"android:layout_width^\"></item>");
- }
-
- public void testRange10() throws Exception {
- // Test missing resource name
- checkRanges("aapterror6.xml", "res/layout/aapterror6.xml",
- "aapterror6.xml:5: error: Error: String types not allowed (at 'layout_marginTop'"
- + " with value '').",
- "android:layout_marginTop=^\"\"",
- "android:layout_marginTop=\"\"^");
- }
-
- public void testRange11() throws Exception {
- // Test missing resource name
- checkRanges("aapterror6.xml", "res/layout/aapterror6.xml",
- "aapterror1.xml:5: error: Error: String types not allowed (at 'layout_marginLeft'"
- + " with value '').",
- "android:layout_marginLeft=^''",
- "android:layout_marginLeft=''^");
- }
-
- public void testRange12() throws Exception {
- // Test missing resource name
- checkRanges("aapterror7.xml", "res/layout/aapterror7.xml",
- "aapterror7.xml:5: error: Error: String types not allowed (at 'id'"
- + " with value '').",
- "android:id=^\"\"",
- "android:id=\"\"^");
- }
-
- private void checkRanges(String name, String destPath, String aaptError,
- String expectCaretBegin, String expectCaretEnd)
- throws Exception {
- IProject project = getProject();
- IFile file = getTestDataFile(project, name, destPath);
-
- // Make file paths absolute
- String osRoot = project.getLocation().toOSString();
- String fileRelativePath = file.getProjectRelativePath().toPortableString();
- String filePath = osRoot + File.separator + fileRelativePath;
- String originalError = filePath + aaptError.substring(aaptError.indexOf(':'));
- List<String> errors = Collections.singletonList(originalError);
-
- // Remove anything already placed there by the project create/build automatic
- // (this usually only happens while debugging so the background thread has a chance
- // to get things going)
- IMarker[] markers = file.findMarkers(AdtConstants.MARKER_AAPT_COMPILE, true,
- IResource.DEPTH_ZERO);
- for (IMarker marker : markers) {
- marker.delete();
- }
-
- AaptParser.parseOutput(errors, project);
- markers = file.findMarkers(AdtConstants.MARKER_AAPT_COMPILE, true,
- IResource.DEPTH_ZERO);
- assertNotNull(markers);
- assertEquals(1, markers.length);
-
- String fileContents = AdtPlugin.readFile(file);
- int rangeBegin = getCaretOffset(file, expectCaretBegin);
- int rangeEnd = getCaretOffset(file, expectCaretEnd);
-
- // Check text range
- IMarker marker = markers[0];
- String message = marker.getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
- String simplerMessage = aaptError.substring(aaptError.indexOf(' ') + 1);
- assertEquals(simplerMessage, message);
- int start = marker.getAttribute(IMarker.CHAR_START, 0);
- int end = marker.getAttribute(IMarker.CHAR_END, 0);
-
- assertEquals("Wrong start offset, expected " + expectCaretBegin + " but was "
- + getCaretContext(fileContents, start), rangeBegin, start);
- assertEquals("Wrong end offset, expected " + expectCaretEnd + " but was "
- + getCaretContext(fileContents, end), rangeEnd, end);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java
deleted file mode 100644
index cc3504f58..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFixTest.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (C) 2011 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.build;
-
-import static com.android.SdkConstants.FD_RES;
-import static com.android.SdkConstants.FD_RES_COLOR;
-import static com.android.SdkConstants.FD_RES_LAYOUT;
-
-import com.android.ide.eclipse.adt.AdtConstants;
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMarkerResolution;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class AaptQuickFixTest extends AdtProjectTest {
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- // Make a separate test project for this test such that we don't pollute code assist
- // tests with our new resources
- return true;
- }
-
- public void testQuickFix1() throws Exception {
- // Test adding a value into an existing file (res/values/strings.xml)
- checkResourceFix("quickfix1.xml", "android:text=\"@string/firs^tstring\"",
- "res/values/strings.xml");
- }
-
- public void testQuickFix2() throws Exception {
- // Test adding a value into a new file (res/values/dimens.xml, will be created)
- checkResourceFix("quickfix1.xml", "android:layout_width=\"@dimen/^testdimen\"",
- "res/values/dimens.xml");
- }
-
- public void testQuickFix3() throws Exception {
- // Test adding a file based resource (uses new file wizard machinery)
- checkResourceFix("quickfix1.xml", "layout=\"@layout/^testlayout\"",
- "res/layout/testlayout.xml");
- }
-
- public void testQuickFix4() throws Exception {
- // Test adding a value into a new file (res/values/dimens.xml, will be created)
- checkNamespaceFix("quickfix2.xml", "<c^olor");
- }
-
- private void checkResourceFix(String name, String caretLocation, String expectedNewPath)
- throws Exception {
- IProject project = getProject();
- IFile file = getTestDataFile(project, name, FD_RES + "/" + FD_RES_LAYOUT + "/" + name);
-
- // Determine the offset
- final int offset = getCaretOffset(file, caretLocation);
-
-
- String osRoot = project.getLocation().toOSString();
- List<String> errors = new ArrayList<String>();
- String fileRelativePath = file.getProjectRelativePath().toPortableString();
- String filePath = osRoot + File.separator + fileRelativePath;
- // Run AaptParser such that markers are added...
- // When debugging these tests, the project gets a chance to build itself so
- // the real aapt errors are there. But when the test is run directly, aapt has
- // not yet run. I tried waiting for the build (using the code in SampleProjectTest)
- // but this had various adverse effects (exception popups from the Eclipse debugger
- // etc) so instead this test just hardcodes the aapt errors that should be
- // observed on quickfix1.xml.
- assertEquals("Unit test is hardcoded to errors for quickfix1.xml", "quickfix1.xml", name);
- errors.add(filePath + ":7: error: Error: No resource found that matches the given name"
- + " (at 'text' with value '@string/firststring').");
- errors.add(filePath + ":7: error: Error: No resource found that matches the given name"
- + " (at 'layout_width' with value '@dimen/testdimen').");
- errors.add(filePath + ":13: error: Error: No resource found that matches the given name"
- + " (at 'layout' with value '@layout/testlayout').");
- AaptParser.parseOutput(errors, project);
-
- AaptQuickFix aaptQuickFix = new AaptQuickFix();
-
- // Open file
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor instanceof AndroidXmlEditor);
- AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
- final ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
-
- // Test marker resolution.
- IMarker[] markers = file.findMarkers(AdtConstants.MARKER_AAPT_COMPILE, true,
- IResource.DEPTH_ZERO);
- for (IMarker marker : markers) {
- int start = marker.getAttribute(IMarker.CHAR_START, 0);
- int end = marker.getAttribute(IMarker.CHAR_END, 0);
- if (offset >= start && offset <= end) {
- // Found the target marker. Now check the marker resolution of it.
- assertTrue(aaptQuickFix.hasResolutions(marker));
- IMarkerResolution[] resolutions = aaptQuickFix.getResolutions(marker);
- assertNotNull(resolutions);
- assertEquals(1, resolutions.length);
- IMarkerResolution resolution = resolutions[0];
- assertNotNull(resolution);
- assertTrue(resolution.getLabel().contains("Create resource"));
-
- // Not running marker yet -- if we create the files here they already
- // exist when the quick assist code runs. (The quick fix and the quick assist
- // mostly share code for the implementation anyway.)
- //resolution.run(marker);
- break;
- }
- }
-
- // Next test quick assist.
-
- IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() {
- @Override
- public int getLength() {
- return 0;
- }
-
- @Override
- public int getOffset() {
- return offset;
- }
-
- @Override
- public ISourceViewer getSourceViewer() {
- return viewer;
- }
- };
- ICompletionProposal[] proposals = aaptQuickFix
- .computeQuickAssistProposals(invocationContext);
- assertNotNull(proposals);
- assertTrue(proposals.length == 1);
- ICompletionProposal proposal = proposals[0];
-
- assertNotNull(proposal.getAdditionalProposalInfo());
- assertNotNull(proposal.getImage());
- assertTrue(proposal.getDisplayString().contains("Create resource"));
-
- IDocument document = new Document();
- String fileContent = AdtPlugin.readFile(file);
- document.set(fileContent);
-
- // Apply quick fix
- proposal.apply(document);
-
- IPath path = new Path(expectedNewPath);
- IFile newFile = project.getFile(path);
- assertNotNull(path.toPortableString(), newFile);
-
- // Ensure that the newly created file was opened
- IEditorPart currentFile = AdtUtils.getActiveEditor();
- assertEquals(newFile.getProjectRelativePath(),
- ((FileEditorInput) currentFile.getEditorInput()).getFile().getProjectRelativePath());
-
- // Look up caret offset
- assertTrue(currentFile != null ? currentFile.getClass().getName() : "null",
- currentFile instanceof AndroidXmlEditor);
- AndroidXmlEditor newEditor = (AndroidXmlEditor) currentFile;
- ISourceViewer newViewer = newEditor.getStructuredSourceViewer();
- Point selectedRange = newViewer.getSelectedRange();
-
- String newFileContents = AdtPlugin.readFile(newFile);
-
- // Insert selection markers -- [ ] for the selection range, ^ for the caret
- String newFileWithCaret = addSelection(newFileContents, selectedRange);
- newFileWithCaret = removeSessionData(newFileWithCaret);
-
- assertEqualsGolden(name, newFileWithCaret);
- }
-
- private void checkNamespaceFix(String name, String caretLocation)
- throws Exception {
- IProject project = getProject();
- IFile file = getTestDataFile(project, name, FD_RES + "/" + FD_RES_COLOR + "/" + name);
-
- // Determine the offset
- final int offset = getCaretOffset(file, caretLocation);
-
- String osRoot = project.getLocation().toOSString();
- List<String> errors = new ArrayList<String>();
- String fileRelativePath = file.getProjectRelativePath().toPortableString();
- String filePath = osRoot + File.separator + fileRelativePath;
- assertEquals("Unit test is hardcoded to errors for quickfix2.xml", "quickfix2.xml", name);
- errors.add(filePath + ":5: error: Error parsing XML: unbound prefix");
- AaptParser.parseOutput(errors, project);
-
- AaptQuickFix aaptQuickFix = new AaptQuickFix();
-
- // Open file
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor instanceof AndroidXmlEditor);
- AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
- final ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
-
- // Test marker resolution.
- IMarker[] markers = file.findMarkers(AdtConstants.MARKER_AAPT_COMPILE, true,
- IResource.DEPTH_ZERO);
- assertEquals(1, markers.length);
- IMarker marker = markers[0];
- // Found the target marker. Now check the marker resolution of it.
- assertTrue(aaptQuickFix.hasResolutions(marker));
- IMarkerResolution[] resolutions = aaptQuickFix.getResolutions(marker);
- assertNotNull(resolutions);
- assertEquals(1, resolutions.length);
- IMarkerResolution resolution = resolutions[0];
- assertNotNull(resolution);
- assertTrue(resolution.getLabel().contains("Insert namespace"));
-
- // Next test quick assist.
-
- IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() {
- @Override
- public int getLength() {
- return 0;
- }
-
- @Override
- public int getOffset() {
- return offset;
- }
-
- @Override
- public ISourceViewer getSourceViewer() {
- return viewer;
- }
- };
- ICompletionProposal[] proposals = aaptQuickFix
- .computeQuickAssistProposals(invocationContext);
- assertNotNull(proposals);
- assertTrue(proposals.length == 1);
- ICompletionProposal proposal = proposals[0];
-
- assertNotNull(proposal.getAdditionalProposalInfo());
- assertNotNull(proposal.getImage());
- assertTrue(proposal.getDisplayString().contains("Insert namespace"));
-
- // Open the file to ensure we can get an XML model with getExistingModelForEdit:
- AdtPlugin.openFile(file, null);
- IEditorPart newEditor = AdtUtils.getActiveEditor();
- assertTrue(newEditor instanceof AndroidXmlEditor);
-
- AndroidXmlEditor xmlEditor = (AndroidXmlEditor) newEditor;
- IDocument document = xmlEditor.getStructuredSourceViewer().getDocument();
-
- // Apply quick fix
- String before = document.get();
- proposal.apply(document);
- String after = document.get();
- String diff = getDiff(before, after);
- assertEqualsGolden(name, diff);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java
deleted file mode 100644
index 700e68bad..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java
+++ /dev/null
@@ -1,990 +0,0 @@
-/*
-
- * Copyright (C) 2011 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.editors;
-
-import static com.android.SdkConstants.FD_RES;
-import static com.android.SdkConstants.FD_RES_ANIM;
-import static com.android.SdkConstants.FD_RES_ANIMATOR;
-import static com.android.SdkConstants.FD_RES_COLOR;
-import static com.android.SdkConstants.FD_RES_DRAWABLE;
-
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.editors.animator.AnimationContentAssist;
-import com.android.ide.eclipse.adt.internal.editors.color.ColorContentAssist;
-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;
-import com.android.ide.eclipse.adt.internal.editors.drawable.DrawableContentAssist;
-import com.android.ide.eclipse.adt.internal.editors.layout.LayoutContentAssist;
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestContentAssist;
-import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestEditor;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-import com.android.ide.eclipse.adt.internal.editors.values.ValuesContentAssist;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-@SuppressWarnings("javadoc")
-public class AndroidContentAssistTest extends AdtProjectTest {
- private static final String CARET = "^"; //$NON-NLS-1$
-
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- return true;
- }
-
- public void testStartsWith() {
- assertTrue(AndroidContentAssist.startsWith("", ""));
- assertTrue(AndroidContentAssist.startsWith("a", ""));
- assertTrue(AndroidContentAssist.startsWith("A", ""));
- assertTrue(AndroidContentAssist.startsWith("A", "a"));
- assertTrue(AndroidContentAssist.startsWith("A", "A"));
- assertTrue(AndroidContentAssist.startsWith("Ab", "a"));
- assertTrue(AndroidContentAssist.startsWith("ab", "A"));
- assertTrue(AndroidContentAssist.startsWith("ab", "AB"));
- assertFalse(AndroidContentAssist.startsWith("ab", "ABc"));
- assertFalse(AndroidContentAssist.startsWith("", "ABc"));
- }
-
- public void testNameStartsWith() {
- String fullWord = "android:marginTop";
- for (int i = 0; i < fullWord.length(); i++) {
- assertTrue(i + ":" + fullWord.substring(0, i),
- AndroidContentAssist.nameStartsWith(
- "android:layout_marginTop", fullWord.substring(0, i), "android:"));
- }
-
- fullWord = "android:layout_marginTop";
- for (int i = 0; i < fullWord.length(); i++) {
- assertTrue(i + ":" + fullWord.substring(0, i),
- AndroidContentAssist.nameStartsWith("android:layout_marginTop", fullWord
- .substring(0, i), "android:"));
- }
-
- fullWord = "layout_marginTop";
- for (int i = 0; i < fullWord.length(); i++) {
- assertTrue(i + ":" + fullWord.substring(0, i),
- AndroidContentAssist.nameStartsWith("android:layout_marginTop", fullWord
- .substring(0, i), "android:"));
- }
-
- fullWord = "marginTop";
- for (int i = 0; i < fullWord.length(); i++) {
- assertTrue(i + ":" + fullWord.substring(0, i),
- AndroidContentAssist.nameStartsWith("android:layout_marginTop", fullWord
- .substring(0, i), "android:"));
- }
-
- assertFalse(AndroidContentAssist.nameStartsWith("ab", "ABc", null));
- assertFalse(AndroidContentAssist.nameStartsWith("", "ABc", null));
- }
-
- public void testCompletion1() throws Exception {
- // Change attribute name completion
- checkLayoutCompletion("completion1.xml", "layout_w^idth=\"fill_parent\"");
- }
-
- public void testCompletion2() throws Exception {
- // Check attribute value completion for enum
- checkLayoutCompletion("completion1.xml", "layout_width=\"^fill_parent\"");
- }
-
- public void testCompletion3() throws Exception {
- // Check attribute value completion for enum with a prefix
- checkLayoutCompletion("completion1.xml", "layout_width=\"fi^ll_parent\"");
- }
-
- public void testCompletion4() throws Exception {
- // Check attribute value completion on units
- checkLayoutCompletion("completion1.xml", "marginBottom=\"50^\"");
- }
-
- public void testCompletion5() throws Exception {
- // Check attribute value completion on units with prefix
- checkLayoutCompletion("completion1.xml", "layout_marginLeft=\"50d^p\"");
- }
-
- public void testCompletion6() throws Exception {
- // Check resource sorting - "style" should bubble to the top for a style attribute
- checkLayoutCompletion("completion1.xml", "style=\"@android:^style/Widget.Button\"");
- }
-
- public void testCompletion7a() throws Exception {
- // Check flags (multiple values inside a single XML value, separated by | - where
- // the prefix is reset as soon as you pass each | )
- checkLayoutCompletion("completion1.xml", "android:gravity=\"l^eft|bottom\"");
- }
-
- public void testCompletion7b() throws Exception {
- checkLayoutCompletion("completion1.xml", "android:gravity=\"left|b^ottom\"");
- }
-
- public void testCompletion8() throws Exception {
- // Test completion right at the "=" sign; this will be taken to be the last
- // character of the attribute name (the caret is between the last char and before
- // the = characters), so it should match a single attribute
- checkLayoutCompletion("completion1.xml", "layout_width^=\"fill_parent\"");
- }
-
- public void testCompletion9() throws Exception {
- // Test completion right after the "=" sign; this will be taken to be the beginning
- // of the attribute value, but all values will also include a leading quote
- checkLayoutCompletion("completion1.xml", "layout_width=^\"fill_parent\"");
- }
-
- public void testCompletion10() throws Exception {
- // Test completion of element names
- checkLayoutCompletion("completion1.xml", "<T^extView");
- }
-
- public void testCompletion11() throws Exception {
- // Test completion of element names at the outside of the <. This should include
- // all the elements too (along with the leading <).
- checkLayoutCompletion("completion1.xml", "^<TextView");
- }
-
- public void testCompletion12() throws Exception {
- // Test completion of element names inside a nested XML; ensure that this will
- // correctly compute element names, not previous attribute
- checkLayoutCompletion("completion1.xml", "btn_default\">^</FrameLayout>");
- }
-
- public void testCompletion13a() throws Exception {
- checkLayoutCompletion("completion2.xml", "gravity=\"left|bottom|^cen");
- }
-
- public void testCompletion13b() throws Exception {
- checkLayoutCompletion("completion2.xml", "gravity=\"left|bottom|cen^");
- }
-
- public void testCompletion13c() throws Exception {
- checkLayoutCompletion("completion2.xml", "gravity=\"left|bottom^|cen");
- }
-
- public void testCompletion14() throws Exception {
- // Test completion of permissions
- checkManifestCompletion("manifest.xml", "android.permission.ACC^ESS_NETWORK_STATE");
- }
-
- public void testCompletion15() throws Exception {
- // Test completion of intents
- checkManifestCompletion("manifest.xml", "android.intent.category.L^AUNCHER");
- }
-
- public void testCompletion16() throws Exception {
- // Test completion of top level elements
- checkManifestCompletion("manifest.xml", "<^application android:i");
- }
-
- public void testCompletion17() throws Exception {
- // Test completion of attributes on the manifest element
- checkManifestCompletion("manifest.xml", "^android:versionCode=\"1\"");
- }
-
- public void testCompletion18() throws Exception {
- // Test completion of attributes on the manifest element
- checkManifestCompletion("manifest.xml",
- "<activity android:^name=\".TestActivity\"");
- }
-
- public void testCompletion19() throws Exception {
- // Test special case where completing on a new element in an otherwise blank line
- // does not add in full completion (with closing tags)
- checkLayoutCompletion("broken3.xml", "<EditT^");
- }
-
- public void testCompletion20() throws Exception {
- checkLayoutCompletion("broken1.xml", "android:textColorHigh^");
- }
-
- public void testCompletion21() throws Exception {
- checkLayoutCompletion("broken2.xml", "style=^");
- }
-
- public void testCompletion22() throws Exception {
- // Test completion where the cursor is inside an element (e.g. the next
- // char is NOT a <) - should not complete with end tags
- checkLayoutCompletion("completion4.xml", "<Button^");
- }
-
- // Test completion in style files
-
- public void testCompletion23() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "android:textS^ize");
- }
-
- public void testCompletion24() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "17^sp");
- }
-
- public void testCompletion25() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "textColor\">^@color/title_color</item>");
- }
-
- public void testCompletion26() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:shadowColor\">@an^</item>");
- }
-
- public void testCompletion27() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:gravity\">^ </item>");
- }
-
- public void testCompletion28() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:gravity\"> ^</item>");
- }
-
- public void testCompletion29() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "<item name=\"gr^\">");
- }
-
- public void testCompletion30() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "<item name=\"an^\">");
- }
-
- public void testCompletion31() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "<item ^></item>");
- }
-
- public void testCompletion32() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "<item name=\"^\"></item>");
- }
-
- public void testCompletion33() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:allowSingleTap\">^</item>");
- }
-
- public void testCompletion34() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:alwaysDrawnWithCache\">^ false </item>");
- }
-
- public void testCompletion35() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:alwaysDrawnWithCache\"> ^false </item>");
- }
-
- public void testCompletion36() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:alwaysDrawnWithCache\"> f^alse </item>");
- }
-
- public void testCompletion37() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- "<item name=\"android:orientation\">h^</item>");
- }
-
- public void testCompletion38() throws Exception {
- checkResourceCompletion("completionvalues1.xml",
- " c^");
- }
-
- public void testCompletion39() throws Exception {
- // If you are at the end of a closing quote (but with no space), completion should
- // include a separating space.
- checkLayoutCompletion("completion1.xml", "marginBottom=\"50\"^");
- }
-
- public void testCompletion40() throws Exception {
- // Same as test 39 but with single quote
- checkLayoutCompletion("completion5.xml", "android:id='@+id/button2'^");
- }
-
- public void testCompletion41() throws Exception {
- // Test prefix matching on layout_ with namespace prefix
- checkLayoutCompletion("completion8.xml", "android:mar^=\"50dp\"");
- }
-
- public void testCompletion42() throws Exception {
- // Test prefix matching on layout_ with namespace prefix
- checkLayoutCompletion("completion8.xml", "android:w^i=\"100\"");
- }
-
- public void testCompletion43() throws Exception {
- // Test prefix matching on layout_ without namespace prefix
- checkLayoutCompletion("completion8.xml", "mar^=\"60dp\"");
- }
-
- public void testCompletion44() throws Exception {
- // Test prefix matching on layout_ without namespace prefix
- checkLayoutCompletion("completion8.xml", "android:layo^ut_width=\"fill_parent\"");
- }
-
- public void testCompletion45() throws Exception {
- // Test top level elements in colors
- checkColorCompletion("color1.xml", "^<selector");
- }
-
- public void testCompletion46a() throws Exception {
- // Test children of selector: should offer item
- checkColorCompletion("color1.xml", "^<item android");
- }
-
- public void testCompletion46b() throws Exception {
- // Test attribute matching in color files
- checkColorCompletion("color1.xml", "<item ^android:state_focused=\"true\"/>");
- }
-
- public void testCompletion47() throws Exception {
- // Check root completion in drawables: should list all drawable root elements
- checkDrawableCompletion("drawable1.xml", "^<layer-list");
- }
-
- public void testCompletion48() throws Exception {
- // Check attributes of the layer list
- checkDrawableCompletion("drawable1.xml", "^xmlns:android");
- }
-
- public void testCompletion49() throws Exception {
- // Check attributes of the <item> element inside a <layer-list>
- checkDrawableCompletion("drawable1.xml", "<item ^></item>");
- }
-
- public void testCompletion50() throws Exception {
- // Check elements nested inside the <item> in a layer list: can use any drawable again
- checkDrawableCompletion("drawable1.xml", "<item >^</item>");
- }
-
- public void testCompletion51() throws Exception {
- // Check attributes of <shape> element
- checkDrawableCompletion("drawable2.xml", "^android:innerRadiusRatio=\"2\"");
- }
-
- public void testCompletion52() throws Exception {
- // Check list of available elements inside a shape
- checkDrawableCompletion("drawable2.xml", "^<gradient");
- }
-
- public void testCompletion53() throws Exception {
- // Check list of root anim elements
- checkAnimCompletion("anim1.xml", "^<set xmlns");
- }
-
- public void testCompletion54() throws Exception {
- // Check that we can nest inside <set>'s
- checkAnimCompletion("anim1.xml", "^<translate android:id=");
- }
-
- public void testCompletion55() throws Exception {
- // translate properties
- checkAnimCompletion("anim1.xml", "android:^fromXDelta=");
- }
-
- public void testCompletion56() throws Exception {
- // alpha properties
- checkAnimCompletion("anim1.xml", "android:^fromAlpha=");
- }
-
- public void testCompletion57() throws Exception {
- // Fractional properties
- checkAnimCompletion("anim1.xml", "android:fromXDelta=\"100^%p\"");
- }
-
- public void testCompletion58() throws Exception {
- // Top level animator elements
- checkAnimatorCompletion("animator1.xml", "^<set xmlns");
- }
-
- public void testCompletion59() throws Exception {
- // objectAnimator properties
- checkAnimatorCompletion("animator1.xml", "android:^duration=\"2000\"");
- }
-
- public void testCompletion60() throws Exception {
- // propertyName completion
- checkAnimatorCompletion("animator1.xml", "android:propertyName=\"scal^eX\"/>");
- }
-
- public void testCompletion61() throws Exception {
- // Interpolator completion
- checkAnimatorCompletion("animator1.xml",
- "android:interpolator=\"^@android:anim/bounce_interpolator\"");
- }
-
- public void testCompletion62() throws Exception {
- // Test completing inside an element that contains .'s, such as a custom view tag
- checkLayoutCompletion("completion9.xml", "android:layout_wi^dth=");
- }
-
- public void testCompletion63() throws Exception {
- // Test attribute completion inside a custom view tag
- // TODO: This works in a running IDE but not in a test context; figure out why.
- //checkLayoutCompletion("completion9.xml", "android:drawable^Top");
- }
-
- public void testCompletion64() throws Exception {
- // Test element completion inside a custom view tag
- checkLayoutCompletion("completion9.xml", "^<Button");
- }
-
- public void testCompletion65() throws Exception {
- // Test completion replacement when there is a selection
- // (see issue http://code.google.com/p/android/issues/detail?id=18607 )
- checkLayoutCompletion("completion10.xml", "\"[^wrap_content]\"");
- }
-
- public void testCompletion66() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "17[^sp]");
- }
-
- public void testCompletion67() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "17[^sp]");
- }
-
- public void testCompletion68() throws Exception {
- checkResourceCompletion("completionvalues1.xml", "[^false]");
- }
-
- public void testCompletion69() throws Exception {
- // Test minimum SDK completion
- checkManifestCompletion("manifest.xml", "<uses-sdk android:minSdkVersion=\"^11\" />");
- }
-
- public void testCompletion70() throws Exception {
- checkResourceCompletion("completionvalues2.xml",
- "<item name=\"main_layout4\" type=\"layout\">^</item>");
- }
-
- public void testCompletion71() throws Exception {
- checkResourceCompletion("completionvalues2.xml",
- "<item name=\"main_layout5\" type=\"string\">@string/^app_name</item>");
- }
-
- public void testCompletion72() throws Exception {
- // Test completion of theme attributes
- checkLayoutCompletion("completion11.xml", "?^android:attr/Textapp");
- }
-
- public void testCompletion73() throws Exception {
- checkLayoutCompletion("completion11.xml", "?android:attr/Textapp^");
- }
-
- public void testCompletion74() throws Exception {
- checkLayoutCompletion("completion11.xml", "?and^roid:attr/Textapp");
- }
-
- public void testCompletion75() throws Exception {
- // Test <include> attributes
- checkLayoutCompletion("completion12.xml", "<include ^/>");
- }
-
- public void testComplation76() throws Exception {
- // Test theme completion with implicit attr
- checkLayoutCompletion("navigation1.xml", "?android:a^ttr/alertDialogStyle");
- }
-
- public void testComplation77() throws Exception {
- // Test <fragment class="^" completion
- checkLayoutCompletion("fragmentlayout.xml", "android:name=\"^com");
- }
-
- public void testComplation78() throws Exception {
- // Test <fragment android:name="^" completion
- checkLayoutCompletion("fragmentlayout.xml", "class=\"^com");
- }
-
- public void testComplation79() throws Exception {
- // Test tools context completion
- checkLayoutCompletion("completion11.xml", "tools:context=\"^.MainActivity\"");
- }
-
- public void testComplation80() throws Exception {
- // Test manifest class completion
- checkManifestCompletion("manifest.xml", "<activity android:name=\"^.");
- }
-
- // TODO: Test <view completion!
-
- // ---- Test *applying* code completion ----
-
- // The following tests check -applying- a specific code completion
- // match - this verifies that the document is updated correctly, the
- // caret is moved appropriately, etc.
-
- public void testApplyCompletion1() throws Exception {
- // Change attribute name completion
- checkApplyLayoutCompletion("completion1.xml", "layout_w^idth=\"fill_parent\"",
- "android:layout_weight");
- }
-
- public void testApplyCompletion2() throws Exception {
- // Check attribute value completion for enum
- checkApplyLayoutCompletion("completion1.xml", "layout_width=\"^fill_parent\"",
- "match_parent");
- }
-
- public void testApplyCompletion3() throws Exception {
- // Check attribute value completion for enum with a prefix
- checkApplyLayoutCompletion("completion1.xml", "layout_width=\"fi^ll_parent\"",
- "fill_parent");
- }
-
- public void testApplyCompletion4() throws Exception {
- // Check attribute value completion on units
- checkApplyLayoutCompletion("completion1.xml", "marginBottom=\"50^\"", "50mm");
- }
-
- public void testApplyCompletion5() throws Exception {
- // Check attribute value completion on units with prefix
- checkApplyLayoutCompletion("completion1.xml", "layout_marginLeft=\"50d^p\"", "50dp");
- }
-
- public void testApplyCompletion6() throws Exception {
- // Check resource sorting - "style" should bubble to the top for a style attribute
- checkApplyLayoutCompletion("completion1.xml", "style=\"@android:^style/Widget.Button\"",
- "@android:drawable/");
- }
-
- public void testApplyCompletion7a() throws Exception {
- // Check flags (multiple values inside a single XML value, separated by | - where
- // the prefix is reset as soon as you pass each | )
- checkApplyLayoutCompletion("completion1.xml", "android:gravity=\"l^eft|bottom\"",
- "left");
- // NOTE - this will replace all flag values with the newly selected value.
- // That may not be the best behavior - perhaps we should only replace one portion
- // of the value.
- }
-
- public void testApplyCompletion7b() throws Exception {
- checkApplyLayoutCompletion("completion1.xml", "android:gravity=\"left|b^ottom\"",
- "bottom");
- // NOTE - this will replace all flag values with the newly selected value.
- // That may not be the best behavior - perhaps we should only replace one portion
- // of the value.
- }
-
- public void testApplyCompletion8() throws Exception {
- // Test completion right at the "=" sign; this will be taken to be the last
- // character of the attribute name (the caret is between the last char and before
- // the = characters), so it should match a single attribute
- checkApplyLayoutCompletion("completion1.xml", "layout_width^=\"fill_parent\"",
- "android:layout_width");
- }
-
- public void testApplyCompletion9() throws Exception {
- // Test completion right after the "=" sign; this will be taken to be the beginning
- // of the attribute value, but all values will also include a leading quote
- checkApplyLayoutCompletion("completion1.xml", "layout_width=^\"fill_parent\"",
- "\"wrap_content\"");
- }
-
- public void testApplyCompletion10() throws Exception {
- // Test completion of element names
- checkApplyLayoutCompletion("completion1.xml", "<T^extView", "TableLayout");
- }
-
- public void testApplyCompletion11a() throws Exception {
- // Test completion of element names at the outside of the <. This should include
- // all the elements too (along with the leading <).
- checkApplyLayoutCompletion("completion1.xml", "^<TextView", "<RadioGroup ></RadioGroup>");
- }
-
- public void testApplyCompletion11b() throws Exception {
- // Similar to testApplyCompletion11a, but replacing with an element that does not
- // have children (to test the closing tag insertion code)
- checkApplyLayoutCompletion("completion1.xml", "^<TextView", "<CheckBox />");
- }
-
- public void testApplyCompletion12() throws Exception {
- // Test completion of element names inside a nested XML; ensure that this will
- // correctly compute element names, not previous attribute
- checkApplyLayoutCompletion("completion1.xml", "btn_default\">^</FrameLayout>",
- "<FrameLayout ></FrameLayout>");
- }
-
- public void testApplyCompletion13a() throws Exception {
- checkApplyLayoutCompletion("completion2.xml", "gravity=\"left|bottom|^cen",
- "fill_vertical");
- }
-
- public void testApplyCompletion13b() throws Exception {
- checkApplyLayoutCompletion("completion2.xml", "gravity=\"left|bottom|cen^",
- "center_horizontal");
- }
-
- public void testApplyCompletion13c() throws Exception {
- checkApplyLayoutCompletion("completion2.xml", "gravity=\"left|bottom^|cen",
- "bottom|fill_horizontal");
- }
-
- public void testApplyCompletion14() throws Exception {
- // Test special case where completing on a new element in an otherwise blank line
- // does not add in full completion (with closing tags)
- checkApplyLayoutCompletion("broken3.xml", "<EditT^", "EditText />");
- }
-
- public void testApplyCompletion15() throws Exception {
- checkApplyLayoutCompletion("broken1.xml", "android:textColorHigh^",
- "android:textColorHighlight");
- }
-
- public void testApplyCompletion16() throws Exception {
- checkApplyLayoutCompletion("broken2.xml", "style=^",
- "\"@android:\"");
- }
-
- public void testApplyCompletion17() throws Exception {
- // Make sure that completion right before a / inside an element still
- // inserts the ="" part (e.g. handles it as "insertNew)
- checkApplyLayoutCompletion("completion3.xml", "<EditText ^/>",
- "android:textColorHighlight");
- }
-
- public void testApplyCompletion18() throws Exception {
- // Make sure that completion right before a > inside an element still
- // inserts the ="" part (e.g. handles it as "insertNew)
- checkApplyLayoutCompletion("completion3.xml", "<Button ^></Button>",
- "android:paddingRight");
- }
-
- public void testApplyCompletion19() throws Exception {
- // Test completion with single quotes (apostrophe)
- checkApplyLayoutCompletion("completion5.xml", "android:orientation='^'", "horizontal");
- }
-
- public void testApplyCompletion20() throws Exception {
- // Test completion with single quotes (apostrophe)
- checkApplyLayoutCompletion("completion5.xml", "android:layout_marginTop='50^dp'", "50pt");
- }
-
- public void testApplyCompletion21() throws Exception {
- // Test completion with single quotes (apostrophe)
- checkApplyLayoutCompletion("completion5.xml", "android:layout_width='^wrap_content'",
- "match_parent");
- // Still broken - but not a common case
- //checkApplyLayoutCompletion("completion5.xml", "android:layout_width=^'wrap_content'",
- // "\"match_parent\"");
- }
-
- public void testApplyCompletion22() throws Exception {
- // Test completion in an empty string
- checkApplyLayoutCompletion("completion6.xml", "android:orientation=\"^\"", "horizontal");
- }
-
- public void testApplyCompletion23() throws Exception {
- // Test completion in an empty string
- checkApplyLayoutCompletion("completion7.xml", "android:orientation=\"^", "horizontal");
- }
-
- // Test completion in style files
-
- public void testApplyCompletion24a() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "android:textS^ize",
- "android:textSelectHandleLeft");
- }
-
- public void testApplyCompletion24b() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "17^sp", "17mm");
- }
-
- public void testApplyCompletion25() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "textColor\">^@color/title_color</item>", "@android:");
- }
-
- public void testApplyCompletion26() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:shadowColor\">@an^</item>", "@android:");
- }
-
- public void testApplyCompletion27() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:gravity\">^ </item>", "center_vertical");
- }
-
- public void testApplyCompletion28() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:gravity\"> ^</item>", "left");
- }
-
- public void testApplyCompletion29() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "<item name=\"gr^\">",
- "android:gravity");
- }
-
- public void testApplyCompletion30() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "<item name=\"an^\">",
- "android:animateOnClick");
- }
-
- public void testApplyCompletion31() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "<item ^></item>", "name");
- }
-
- public void testApplyCompletion32() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "<item name=\"^\"></item>",
- "android:background");
- }
-
- public void testApplyCompletion33() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:allowSingleTap\">^</item>", "true");
- }
-
- public void testApplyCompletion34() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:alwaysDrawnWithCache\">^ false </item>", "true");
- }
-
- public void testApplyCompletion35() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:alwaysDrawnWithCache\"> ^false </item>", "true");
- }
-
- public void testApplyCompletion36() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:alwaysDrawnWithCache\"> f^alse </item>", "false");
- }
-
- public void testApplyCompletion37() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- "<item name=\"android:orientation\">h^</item>", "horizontal");
- }
-
- public void testApplyCompletion38() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml",
- " c^", "center");
- }
-
- public void testApplyCompletion39() throws Exception {
- // If you are at the end of a closing quote (but with no space), completion should
- // include a separating space.
- checkApplyLayoutCompletion("completion1.xml", "marginBottom=\"50\"^", " android:maxEms");
- }
-
- public void testApplyCompletion40() throws Exception {
- // If you are at the end of a closing quote (but with no space), completion should
- // include a separating space.
- checkApplyLayoutCompletion("completion5.xml", "android:id='@+id/button2'^",
- " android:maxWidth");
- }
-
- public void testApplyCompletion41() throws Exception {
- // Test prefix matching on layout_ with namespace prefix
- checkApplyLayoutCompletion("completion8.xml", "android:mar^=\"50dp\"",
- "android:layout_marginRight");
- }
-
- public void testApplyCompletion42() throws Exception {
- // Test completion replacement when there is a selection
- // (see issue http://code.google.com/p/android/issues/detail?id=18607 )
- checkApplyLayoutCompletion("completion10.xml", "\"[^wrap_content]\"", "fill_parent");
- }
-
- public void testApplyCompletion43() throws Exception {
- // Same as testApplyCompletion42 but with a smaller selection range
- checkApplyLayoutCompletion("completion10.xml", "\"[^wrap_c]ontent\"", "fill_parent");
- }
-
- public void testApplyCompletion44() throws Exception {
- checkApplyResourceCompletion("completionvalues1.xml", "[^false]", "true");
- }
-
- public void testApplyCompletion45() throws Exception {
- checkApplyResourceCompletion("completionvalues2.xml",
- "@string/^app_name", "@string/hello");
- }
-
- public void testApplyCompletion46() throws Exception {
- checkApplyLayoutCompletion("completion11.xml",
- "?android:attr/Textapp^", "?android:attr/textAppearanceLargeInverse");
- }
-
- public void testApplyCompletion47() throws Exception {
- // Test applying <fragment android:name="^" completion
- checkApplyLayoutCompletion("fragmentlayout.xml", "class=\"^com",
- "android.app.ListFragment");
- }
-
- // --- Code Completion test infrastructure ----
-
- private void checkLayoutCompletion(String name, String caretLocation) throws Exception {
- IFile file = getLayoutFile(getProject(), name);
- IDE.setDefaultEditor(file, CommonXmlEditor.ID);
- checkCompletion(name, file, caretLocation,
- new LayoutContentAssist());
- }
-
- private void checkColorCompletion(String name, String caretLocation) throws Exception {
- IFile file = getTestDataFile(getProject(), name, FD_RES + "/" + FD_RES_COLOR + "/" + name);
- IDE.setDefaultEditor(file, CommonXmlEditor.ID);
- checkCompletion(name, file, caretLocation, new ColorContentAssist());
- }
-
- private void checkAnimCompletion(String name, String caretLocation) throws Exception {
- IFile file = getTestDataFile(getProject(), name, FD_RES + "/" + FD_RES_ANIM + "/" + name);
- IDE.setDefaultEditor(file, CommonXmlEditor.ID);
- checkCompletion(name, file, caretLocation, new AnimationContentAssist());
- }
-
- private void checkAnimatorCompletion(String name, String caretLocation) throws Exception {
- IFile file = getTestDataFile(getProject(), name, FD_RES + "/" + FD_RES_ANIMATOR + "/"
- + name);
- IDE.setDefaultEditor(file, CommonXmlEditor.ID);
- checkCompletion(name, file, caretLocation, new AnimationContentAssist());
- }
-
- private void checkDrawableCompletion(String name, String caretLocation) throws Exception {
- IFile file = getTestDataFile(getProject(), name, FD_RES + "/" + FD_RES_DRAWABLE + "/"
- + name);
- IDE.setDefaultEditor(file, CommonXmlEditor.ID);
- checkCompletion(name, file, caretLocation, new DrawableContentAssist());
- }
-
- private void checkManifestCompletion(String name, String caretLocation) throws Exception {
- // Manifest files must be named AndroidManifest.xml. Must overwrite to replace
- // the default manifest created in the test project.
- IFile file = getTestDataFile(getProject(), name, "AndroidManifest.xml", true);
- IDE.setDefaultEditor(file, ManifestEditor.ID);
-
- checkCompletion(name, file, caretLocation,
- new ManifestContentAssist());
- }
-
- private void checkApplyLayoutCompletion(String name, String caretLocation,
- String match) throws Exception {
- checkApplyCompletion(name, getLayoutFile(getProject(), name), caretLocation,
- new LayoutContentAssist(), match);
- }
-
- private void checkResourceCompletion(String name, String caretLocation) throws Exception {
- checkCompletion(name, getValueFile(getProject(), name), caretLocation,
- new ValuesContentAssist());
- }
-
- private void checkApplyResourceCompletion(String name, String caretLocation,
- String match) throws Exception {
- checkApplyCompletion(name, getValueFile(getProject(), name), caretLocation,
- new ValuesContentAssist(), match);
- }
-
- private ICompletionProposal[] complete(IFile file, String caretLocation,
- AndroidContentAssist assist) throws Exception {
-
- // Open file
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor instanceof AndroidXmlEditor);
- AndroidXmlEditor xmlEditor = (AndroidXmlEditor) editor;
-
- UiElementNode root = xmlEditor.getUiRootNode();
- ElementDescriptor descriptor = root.getDescriptor();
- if (descriptor instanceof ViewElementDescriptor) {
- ViewElementDescriptor vd = (ViewElementDescriptor) descriptor;
- AttributeDescriptor[] attributes = vd.getAttributes();
- assertTrue(Integer.toString(attributes.length), attributes.length > 0);
- }
-
- ISourceViewer viewer = xmlEditor.getStructuredSourceViewer();
-
- // Determine the offset, and possibly make text range selections as well
- int offset = updateCaret(viewer, caretLocation);
-
- // Run code completion
- ICompletionProposal[] proposals = assist.computeCompletionProposals(viewer, offset);
- if (proposals == null) {
- proposals = new ICompletionProposal[0];
- }
-
- editor.getEditorSite().getPage().closeAllEditors(false);
-
- return proposals;
- }
-
- private void checkApplyCompletion(String basename, IFile file, String caretLocation,
- AndroidContentAssist assist, String match) throws Exception {
- ICompletionProposal[] proposals = complete(file, caretLocation, assist);
- ICompletionProposal chosen = null;
- for (ICompletionProposal proposal : proposals) {
- if (proposal.getDisplayString().equals(match)) {
- chosen = proposal;
- break;
- }
- }
- assertNotNull(chosen);
- assert chosen != null; // Eclipse null pointer analysis doesn't believe the JUnit assertion
-
- String fileContent = AdtPlugin.readFile(file);
- IDocument document = new Document();
- document.set(fileContent);
-
- // Apply code completion
- chosen.apply(document);
-
- // Insert caret location as well
- Point location = chosen.getSelection(document);
- document.replace(location.x, 0, CARET);
-
- String actual = document.get();
-
- int offset = getCaretOffset(fileContent, caretLocation);
- String beforeWithCaret = fileContent.substring(0, offset) + CARET
- + fileContent.substring(offset);
-
- String diff = getDiff(beforeWithCaret, actual);
- assertTrue(diff + " versus " + actual, diff.length() > 0 || beforeWithCaret.equals(actual));
-
- StringBuilder summary = new StringBuilder();
- summary.append("Code completion in " + basename + " for " + caretLocation + " selecting "
- + match + ":\n");
- if (diff.length() == 0) {
- diff = "No changes";
- }
- summary.append(diff);
-
- // assertEqualsGolden(basename, actual);
- assertEqualsGolden(basename, summary.toString(), "diff");
- }
-
- private void checkCompletion(String basename, IFile file, String caretLocation,
- AndroidContentAssist assist) throws Exception {
- ICompletionProposal[] proposals = complete(file, caretLocation, assist);
- StringBuilder sb = new StringBuilder(1000);
- sb.append("Code completion in " + basename + " for " + caretLocation + ":\n");
- for (ICompletionProposal proposal : proposals) {
- // TODO: assertNotNull(proposal.getImage());
- int length = sb.length();
- sb.append(proposal.getDisplayString().trim());
- String help = proposal.getAdditionalProposalInfo();
- if (help != null && help.trim().length() > 0) {
- sb.append(" : ");
- sb.append(help.replace('\n', ' ').trim());
- if (sb.length() > length + 300) {
- sb.setLength(length + 300 - "...".length());
- sb.append("...");
- }
- }
- sb.append('\n');
- }
- assertEqualsGolden(basename, sb.toString(), "txt");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategyTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategyTest.java
deleted file mode 100644
index 27661b3f2..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategyTest.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors;
-
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.DocumentCommand;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-@SuppressWarnings("javadoc")
-public class AndroidXmlAutoEditStrategyTest extends AdtProjectTest {
-
- public void checkInsertNewline(String before, String after) throws Exception {
- AndroidXmlAutoEditStrategy s = new AndroidXmlAutoEditStrategy();
-
- // All tests just operate on the "edithandling" document; the contents are
- // ignored and replaced with the before-document passed in
- IFile file = getLayoutFile(getProject(), "edithandling.xml");
-
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor instanceof AndroidXmlEditor);
- AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
- ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
-
- String newDocumentContent = stripCaret(before);
- IDocument document = viewer.getDocument();
- document.replace(0, document.getLength(), newDocumentContent);
-
- // Determine the offset, and possibly make text range selections as well
- int offset = updateCaret(viewer, before);
-
- DocumentCommand c = new TestDocumentCommand();
- c.doit = true;
- c.offset = offset;
- c.caretOffset = -1;
- c.length = 0;
- c.text = "\n";
-
- s.customizeDocumentCommand(document, c);
-
- if (c.doit) {
- if (c.length == 0 && c.text == null) {
- return;
- }
-
- document.replace(c.offset, c.length, c.text);
-
- int caretOffset = c.offset + c.text.length();
-
- // The shiftsCaret flag doesn't behave the way it's documented to
- //if (c.shiftsCaret && c.caretOffset != -1) {
- if (c.caretOffset != -1) {
- caretOffset = c.caretOffset;
- }
- viewer.setSelectedRange(caretOffset, 0);
- }
-
- String text = document.get();
- Point selectedRange = viewer.getSelectedRange();
- assert selectedRange.y == 0;
- String textWithCaret = text;
- if (selectedRange.x >= 0) {
- textWithCaret = text.substring(0, selectedRange.x) + "^" +
- text.substring(selectedRange.x);
- }
-
- assertEquals(after, textWithCaret);
- }
-
- private static String stripCaret(String s) {
- int index = s.indexOf('^');
- assertTrue(index != -1);
- return s.substring(0, index) + s.substring(index + 1);
- }
-
- public void testCornerCase1() throws Exception {
- checkInsertNewline("^", "\n^");
- }
-
- public void testCornerCase2() throws Exception {
- checkInsertNewline(
- "\n^",
-
- "\n\n^");
- }
-
- public void testCornerCase3() throws Exception {
- checkInsertNewline(
- " ^",
-
- " \n" +
- " ^");
- }
-
- public void testSimpleIndentation1() throws Exception {
- checkInsertNewline(
- " ^ ",
-
- " \n" +
- " ^ ");
- }
-
- public void testSimpleIndentation2() throws Exception {
- checkInsertNewline(
- "\n" +
- " foo^\n",
-
- "\n" +
- " foo\n" +
- " ^\n");
- }
-
- public void testSimpleIndentation3() throws Exception {
- checkInsertNewline(
- "\n" +
- " <newtag>^\n",
-
- "\n" +
- " <newtag>\n" +
- " ^\n");
- }
-
- public void testSimpleIndentation4() throws Exception {
- checkInsertNewline(
- "\n" +
- " <newtag/>^\n",
-
- "\n" +
- " <newtag/>\n" +
- " ^\n");
- }
-
- public void testSimpleIndentation5() throws Exception {
- checkInsertNewline(
- "\n" +
- " <newtag^\n",
- "\n" +
- " <newtag\n" +
- " ^\n");
- }
-
- public void testSplitAttribute() throws Exception {
- checkInsertNewline(
- "\n" +
- " <newtag ^attribute='value'/>\n",
-
- "\n" +
- " <newtag \n" +
- " ^attribute='value'/>\n");
- }
-
- public void testIndentationInComments1() throws Exception {
- // Make sure that inside a comment we ignore tags etc
- checkInsertNewline(
- "<!--\n foo^\n--->\n",
-
- "<!--\n foo\n ^\n--->\n");
- }
-
- public void testIndentationInComments2() throws Exception {
- // Make sure that inside a comment we ignore tags etc
- checkInsertNewline(
- "\n" +
- "<!--\n" +
- "<foo><^\n" +
- "-->\n",
-
- "\n" +
- "<!--\n" +
- "<foo><\n" +
- "^\n" +
- "-->\n");
- }
-
- public void testSurroundCaret() throws Exception {
- checkInsertNewline(
- "\n" +
- " <item>^</item>\n",
-
- "\n" +
- " <item>\n" +
- " ^\n" +
- " </item>\n");
- }
-
- public void testSurroundCaret2() throws Exception {
- // This test combines both surround with and continuing earlier lines (where
- // it searches for a matching tag)
- checkInsertNewline(
- "\n" +
- " <foo\n" +
- " name='value'>^</foo>\n",
-
- "\n" +
- " <foo\n" +
- " name='value'>\n" +
- " ^\n" +
- " </foo>\n");
- }
-
- public void testContinueEarlierLine1() throws Exception {
- // Here we need to indent to the exact location of an earlier line
- checkInsertNewline(
- "\n" +
- " <foo\n" +
- " name='value'/>^\n",
-
- "\n" +
- " <foo\n" +
- " name='value'/>\n" +
- " ^\n");
- }
-
- public void testContinueEarlierLine2() throws Exception {
- checkInsertNewline(
- "\n" +
- " <foo\n" +
- " name='value'></foo>^\n",
-
- "\n" +
- " <foo\n" +
- " name='value'></foo>\n" +
- " ^\n");
- // Note that
- // <foo
- // >
- // </foo>
- // does not require special handling, this only happens with the closing tag is sharing
- // a line.
- }
-
- public void testContinueEarlierLine3() throws Exception {
- // Make sure the code to look up the corresponding opening tag works properly
- checkInsertNewline(
- "\n" +
- " <foo\n" +
- " name='value'><bar></bar><baz/></foo>^\n",
-
- "\n" +
- " <foo\n" +
- " name='value'><bar></bar><baz/></foo>\n" +
- " ^\n");
- }
-
- public void testContinueEarlierLine4() throws Exception {
- checkInsertNewline(
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:text=\"Button\" >^\n" +
- " </Button>\n",
-
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:text=\"Button\" >\n" +
- " ^\n" +
- " </Button>\n");
- }
-
- public void testIndent() throws Exception {
- checkInsertNewline(
- " <Button\n" +
- " attr=\"value\"></Button>^\n",
-
- " <Button\n" +
- " attr=\"value\"></Button>\n" +
- " ^\n" +
- "");
- }
-
- public void testLineBeginning1() throws Exception {
- // Test that if you insert on a blank line, we just add a newline and indent
- checkInsertNewline(
- "<foo>\n" +
- "^\n" +
- "</foo>",
-
- "<foo>\n" +
- "\n" +
- " ^\n" +
- "</foo>");
- }
-
- public void testLineBeginning2() throws Exception {
- // Test that if you insert with the caret on the beginning of a line that has
- // content, we insert an indent correctly
- checkInsertNewline(
- "<foo>\n" +
- "^ <bar/>\n" +
- "</foo>",
-
- "<foo>\n" +
- "\n" +
- " ^<bar/>\n" +
- "</foo>");
- }
-
- public void testLineBeginning3() throws Exception {
- checkInsertNewline(
- "<foo>\n" +
- " <bar>\n" +
- "^\n" +
- " <baz/>\n" +
- " </bar>\n" +
- "</foo>",
-
- "<foo>\n" +
- " <bar>\n" +
- "\n" +
- " ^\n" +
- " <baz/>\n" +
- " </bar>\n" +
- "</foo>");
-
- }
-
- public void testLineBeginning4() throws Exception {
- // Test that if you insert with the caret on the beginning of a line that has
- // content, we insert an indent correctly
- checkInsertNewline(
- "<foo>\n" +
- " <bar>\n" +
- "\n" +
- "^ <baz/>\n" +
- " </bar>\n" +
- "</foo>",
-
- "<foo>\n" +
- " <bar>\n" +
- "\n" +
- "\n" +
- " ^<baz/>\n" +
- " </bar>\n" +
- "</foo>");
- }
-
- public void testLineBeginning5() throws Exception {
- // Test that if you insert with the caret on the beginning of a line that has
- // content, we insert an indent correctly
- checkInsertNewline(
- "<foo>\n" +
- " <bar>\n" +
- "\n" +
- " ^ <baz/>\n" +
- " </bar>\n" +
- "</foo>",
-
- "<foo>\n" +
- " <bar>\n" +
- "\n" +
- " \n" +
- " ^<baz/>\n" +
- " </bar>\n" +
- "</foo>");
- }
-
- public void testLineBeginning6() throws Exception {
-
- checkInsertNewline(
- " <foo>\n" +
- " <bar>\n" +
- " \n" +
- " \n" +
- "^ </bar>\n" +
- " </foo>\n",
-
- " <foo>\n" +
- " <bar>\n" +
- " \n" +
- " \n" +
- "\n" +
- " ^</bar>\n" +
- " </foo>\n");
- }
-
- public void testBlankContinuation() throws Exception {
-
- checkInsertNewline(
- " <foo>\n" +
- " <bar>\n" +
- " ^\n" +
- " </bar>\n" +
- " </foo>\n" +
- "",
-
- " <foo>\n" +
- " <bar>\n" +
- " \n" +
- " ^\n" +
- " </bar>\n" +
- " </foo>\n" +
- "");
- }
-
- public void testIssue22332a() throws Exception {
- checkInsertNewline(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"hello\">Hello World, MainActivity!</string>^\n" +
- "\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"hello\">Hello World, MainActivity!</string>\n" +
- " ^\n" +
- "\n" +
- "</resources>");
- }
-
- public void testIssue22332b() throws Exception {
- checkInsertNewline(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"hello\">Hello World, MainActivity!</string>\n" +
- " ^\n" +
- "\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"hello\">Hello World, MainActivity!</string>\n" +
- " \n" +
- " ^\n" +
- "\n" +
- "</resources>");
- }
-
- /**
- * To test
- * When you press / after < I should reindent the current line. For example,
- * if you have
- * <foo>
- * <bar>
- * </ the moment you've typed this we should dedent it back out
- * When you press newline we need to reindent
- */
-
- /** Subclassed for test usage since constructor is protected */
- private class TestDocumentCommand extends DocumentCommand {
- public TestDocumentCommand() {
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlCharacterMatcherTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlCharacterMatcherTest.java
deleted file mode 100644
index acb2b049b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlCharacterMatcherTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors;
-
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-@SuppressWarnings("restriction")
-public class AndroidXmlCharacterMatcherTest extends AdtProjectTest {
- public void testGotoMatchingFwd1() throws Exception {
- checkGotoMatching(
- "<app^lication android:icon",
- "^</application>");
- }
-
- public void testGotoMatchingFwd2() throws Exception {
- checkGotoMatching(
- "^<application android:icon",
- "^</application>");
- }
-
- public void testGotoMatchingFwd3() throws Exception {
- checkGotoMatching(
- "<application^ android:icon",
- "^</application>");
- }
-
- public void testGotoMatchingBwd1() throws Exception {
- checkGotoMatching(
- "^</application>",
- "^<application android:icon");
- }
-
- public void testGotoMatchingBwd2() throws Exception {
- checkGotoMatching(
- "<^/application>",
- "^<application android:icon");
- }
-
- public void testGotoMatchingBwd3() throws Exception {
- checkGotoMatching(
- "</^application>",
- "^<application android:icon");
- }
-
- public void testGotoMatchingBwd4() throws Exception {
- checkGotoMatching(
- "</app^lication>",
- "^<application android:icon");
- }
-
- public void testGotoMatchingBwd5() throws Exception {
- checkGotoMatching(
- "</^application>",
- "^<application android:icon");
- }
-
- public void testGotoMatchingBwd6() throws Exception {
- checkGotoMatching(
- "</^application>",
- "^<application android:icon");
- }
-
- public void testGotoMatchingFwd4() throws Exception {
- checkGotoMatching(
- "<intent-filter^>",
- "^</intent-filter>");
- }
-
- public void testGotoMatchingFwd5() throws Exception {
- checkGotoMatching(
- "<intent-filter>^",
- "^</intent-filter>");
- }
-
- public void testGotoMatchingFallback() throws Exception {
- // Character matching is done by the superclass; ensure that fallback to the
- // other XML matchers is working
- checkGotoMatching(
- "android:icon=^\"@drawable/icon\"",
- "android:icon=\"@drawable/icon^\"");
- }
-
- private void checkGotoMatching(IFile file, String caretBefore,
- String caretAfter) throws Exception {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor instanceof AndroidXmlEditor);
- AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
- ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
-
- int caretPosBefore = updateCaret(viewer, caretBefore);
-
- AndroidXmlCharacterMatcher matcher = new AndroidXmlCharacterMatcher();
- IStructuredDocument document = layoutEditor.getStructuredDocument();
-
- IRegion match = matcher.match(document, caretPosBefore);
- assertNotNull(match);
-
- String text = document.get();
- final String after = stripCaret(caretAfter);
- int index = text.indexOf(after);
- int caretPosAfter = match.getOffset() - index;
- String textWithCaret = after.substring(0, caretPosAfter)
- + "^" + after.substring(caretPosAfter);
-
- assertEquals(caretAfter, textWithCaret);
- }
-
- private static String stripCaret(String s) {
- int index = s.indexOf('^');
- assertTrue(index != -1);
- return s.substring(0, index) + s.substring(index + 1);
- }
-
- private void checkGotoMatching(String caretBefore,
- String caretAfter) throws Exception {
- checkGotoMatching(
- getTestDataFile(getProject(), "manifest.xml", "AndroidManifest.xml", true),
- caretBefore, caretAfter);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java
deleted file mode 100644
index 20aae846b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors;
-
-import static com.android.SdkConstants.FD_SOURCES;
-
-import com.android.ide.common.resources.ResourceFile;
-import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.Hyperlinks.ResourceLink;
-import com.android.ide.eclipse.adt.internal.editors.Hyperlinks.XmlResolver;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.internal.ErrorEditorPart;
-import org.eclipse.ui.internal.browser.WebBrowserEditor;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
-import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-@SuppressWarnings({
- "restriction", "javadoc"
-})
-public class HyperlinksTest extends AdtProjectTest {
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- return true;
- }
-
- public void testFqnRegexp() throws Exception {
- assertTrue(Hyperlinks.isViewClassName("com.android.Foo"));
- assertTrue(Hyperlinks.isViewClassName("com.android.pk_g.Foo_Bar1"));
- assertTrue(Hyperlinks.isViewClassName("com.android.Foo$Inner"));
-
- // Should we allow non-standard packages and class names?
- // For now, we're allowing it -- see how this works out in practice.
- //assertFalse(XmlHyperlinkResolver.isViewClassName("Foo.bar"));
- assertTrue(Hyperlinks.isViewClassName("Foo.bar"));
-
- assertFalse(Hyperlinks.isViewClassName("LinearLayout"));
- assertFalse(Hyperlinks.isViewClassName("."));
- assertFalse(Hyperlinks.isViewClassName(".F"));
- assertFalse(Hyperlinks.isViewClassName("f."));
- assertFalse(Hyperlinks.isViewClassName("Foo"));
- assertFalse(Hyperlinks.isViewClassName("com.android.1Foo"));
- assertFalse(Hyperlinks.isViewClassName("1com.Foo"));
- }
-
- public void testNavigate1() throws Exception {
- // Check navigating to a local resource
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "android:text=\"@string/app^_name\"");
- }
-
- public void testNavigate2() throws Exception {
- // Check navigating to a framework resource
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "marginLeft=\"@android:dimen/app_ico^n_size\"");
- }
-
- public void testNavigate3() throws Exception {
- // Check navigating to a style
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "style=\"@android:style/Widget.B^utton\"");
- }
-
- public void testNavigate4() throws Exception {
- // Check navigating to resource with many resolutions
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "android:text=\"@android:st^ring/ok\"");
- }
-
- public void testNavigate5() throws Exception {
- // Check navigating to styles
- checkXmlNavigation("navigationstyles.xml", "res/values/navigationstyles.xml",
- "parent=\"android:Theme.Li^ght\">");
- }
-
- public void testNavigate6() throws Exception {
- // Check navigating to a portion of a style (this should pick android:Theme, not
- // android:Theme.Light
- checkXmlNavigation("navigationstyles.xml", "res/values/navigationstyles.xml",
- "parent=\"android:The^me.Light\">");
- }
-
- public void testNavigate7() throws Exception {
- // Check navigating to a resource inside text content
- checkXmlNavigation("navigationstyles.xml", "res/values/navigationstyles.xml",
- "popupBackground\">@android:drawable/spinner_dr^opdown_background</item>");
- }
-
- public void testNavigate8() throws Exception {
- // Check navigating to a resource inside text content where there is space around
- // the URL
- checkXmlNavigation("navigationstyles.xml", "res/values/navigationstyles.xml",
- "colorBackground\"> @color/cust^om_theme_color </item>");
- }
-
- public void testNavigate9a() throws Exception {
- // Check navigating to a an activity
- checkXmlNavigation("manifest.xml", "AndroidManifest.xml",
- "<activity android:name=\".Test^Activity\"");
- }
-
- /* Not yet implemented
- public void testNavigate9b() throws Exception {
- // Check navigating to a an activity - clicking on the activity element should
- // work too
- checkXmlNavigation("manifest.xml", "AndroidManifest.xml",
- "<acti^vity android:name=\".TestActivity\"");
- }
- */
-
- public void testNavigate10() throws Exception {
- // Check navigating to a permission
- checkXmlNavigation("manifest.xml", "AndroidManifest.xml",
- "<uses-permission android:name=\"android.permission.AC^CESS_NETWORK_STATE\" />");
- }
-
- public void testNavigate11a() throws Exception {
- // Check navigating to an intent
- checkXmlNavigation("manifest.xml", "AndroidManifest.xml",
- "<action android:name=\"android.intent.ac^tion.MAIN\" />");
- }
-
- public void testNavigate11g() throws Exception {
- // Check navigating to an intent
- checkXmlNavigation("manifest.xml", "AndroidManifest.xml",
- "<category android:name=\"android.intent.category.LA^UNCHER\" />");
- }
-
- public void testNavigate12() throws Exception {
- // Check navigating to a custom view class
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "<my.Cust^omView></my.CustomView>");
- }
-
- public void testNavigate13() throws Exception {
- // Check jumping to classes pointed to by fragments
-
- getTestDataFile(getProject(), "TestFragment.java.txt",
- FD_SOURCES + "/" + TEST_PROJECT_PACKAGE.replace('.', '/') + "/TestFragment.java");
- checkXmlNavigation("fragmentlayout.xml", "res/layout/fragmentlayout.xml",
- "android:name=\"com.android.ecl^ipse.tests.TestFragment\"");
- }
-
- public void testNavigate14() throws Exception {
- // Check jumping to classes pointed to by fragments
-
- getTestDataFile(getProject(), "TestFragment.java.txt",
- FD_SOURCES + "/" + TEST_PROJECT_PACKAGE.replace('.', '/') + "/TestFragment.java");
- checkXmlNavigation("fragmentlayout.xml", "res/layout/fragmentlayout.xml",
- "class=\"com.and^roid.eclipse.tests.TestFragment\"");
- }
-
- public void testNavigate15() throws Exception {
- // Check navigating to a theme resource
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "?android:attr/alert^DialogStyle");
- }
-
- public void testNavigate16() throws Exception {
- // Check navigating to a theme resource
- checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
- "?android:alert^DialogStyle");
- }
-
- // Left to test:
- // onClick handling
- // class attributes
- // Test that the correct file is actually opened!
-
- private void checkXmlNavigation(String basename, String targetPath,
- String caretLocation) throws Exception {
- IFile file = getTestDataFile(getProject(), basename, targetPath, true);
-
- // Determine the offset
- int offset = getCaretOffset(file, caretLocation);
-
- // Open file
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor.getClass().getName(), editor instanceof AndroidXmlEditor);
- AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
- ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
-
- XmlResolver resolver = new Hyperlinks.XmlResolver();
- IHyperlink[] links = resolver.detectHyperlinks(viewer, new Region(offset, 0), true);
- assertNotNull(links);
-
- StringBuilder sb = new StringBuilder(1000);
- sb.append("Go To Declaration in " + basename + " for " + caretLocation + ":\n");
- for (IHyperlink link : links) {
- sb.append(link.getHyperlinkText());
- sb.append(" : ");
- sb.append(" [");
- IRegion region = link.getHyperlinkRegion();
- sb.append(viewer.getDocument().get(region.getOffset(), region.getLength()));
- sb.append("]");
- if (link instanceof Hyperlinks.ResourceLink) {
- Hyperlinks.ResourceLink resourceLink = (ResourceLink) link;
- sb.append("\n ");
- ResourceFile resourceFile = resourceLink.getFile();
- String desc = resourceFile.toString();
- desc = desc.replace('\\', '/');
- // For files in the SDK folder, strip out file prefix
- int dataRes = desc.indexOf("data/res");
- if (dataRes != -1) {
- desc = desc.substring(dataRes);
- }
- desc = removeSessionData(desc);
- sb.append(desc);
- }
- sb.append('\n');
- }
-
- // Open the first link
- IHyperlink link = links[0];
- link.open();
- IEditorPart newEditor = AdtUtils.getActiveEditor();
- // Ensure that this isn't an invalid file (e.g. opening the SDK platform files
- // with incorrect content binding could cause this)
- assertTrue(!(newEditor instanceof ErrorEditorPart));
-
- IDocument document = null;
- Point selection = null;
-
- if (newEditor instanceof AndroidXmlEditor) {
- AndroidXmlEditor xmlEditor = (AndroidXmlEditor) newEditor;
- document = xmlEditor.getStructuredSourceViewer().getDocument();
- selection = xmlEditor.getStructuredSourceViewer().getSelectedRange();
- } else if (newEditor instanceof XMLMultiPageEditorPart) {
- XMLMultiPageEditorPart xmlEditor = (XMLMultiPageEditorPart) newEditor;
- Field field = xmlEditor.getClass().getDeclaredField("fTextEditor");
- field.setAccessible(true);
- StructuredTextEditor ste = (StructuredTextEditor) field.get(newEditor);
- if (ste == null) {
- Method method = xmlEditor.getClass().getMethod("getTextEditor", new Class[0]);
- ste = (StructuredTextEditor) method.invoke(newEditor, new Object[0]);
- }
- StructuredTextViewer textViewer = ste.getTextViewer();
- document = textViewer.getDocument();
- selection = textViewer.getSelectedRange();
- } else if (newEditor instanceof WebBrowserEditor) {
- WebBrowserEditor browser = (WebBrowserEditor) newEditor;
- Field field = browser.getClass().getDeclaredField("initialURL");
- field.setAccessible(true);
- String initialUrl = (String) field.get(newEditor);
- int index = initialUrl.indexOf("reference");
- if (index != -1) {
- initialUrl = initialUrl.substring(index);
- }
- initialUrl = initialUrl.replace('\\', '/');
- sb.append("\n\nAfter open, a browser is shown with this URL:\n");
- sb.append(" ");
- sb.append(initialUrl);
- sb.append("\n");
- } else if (newEditor instanceof JavaEditor) {
- JavaEditor javaEditor = (JavaEditor) newEditor;
- document = javaEditor.getDocumentProvider().getDocument(javaEditor.getEditorInput());
- IRegion range = javaEditor.getHighlightRange();
- selection = new Point(range.getOffset(), range.getLength());
- } else {
- fail("Unhandled editor type: " + newEditor.getClass().getName());
- return;
- }
-
- if (document != null && selection != null) {
- int lineStart = document.getLineInformationOfOffset(selection.x).getOffset();
- IRegion lineEndInfo = document.getLineInformationOfOffset(selection.x + selection.y);
- int lineEnd = lineEndInfo.getOffset() + lineEndInfo.getLength();
- String text = document.get(lineStart, lineEnd - lineStart);
- int selectionStart = selection.x - lineStart;
- int selectionEnd = selectionStart + selection.y;
- if (selectionEnd > selectionStart) {
- // Selection range
- text = text.substring(0, selectionStart) + "[^" +
- text.substring(selectionStart, selectionEnd) + "]" +
- text.substring(selectionEnd);
- } else {
- text = text.substring(0, selectionStart) + "^" +
- text.substring(selectionStart);
- }
- text = removeSessionData(text);
-
- sb.append("\n\nAfter open, the selected text is:\n");
- sb.append(text);
- sb.append("\n");
- }
-
- assertEqualsGolden(basename, sb.toString(), "txt");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java
deleted file mode 100644
index ac5fd0196..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java
+++ /dev/null
@@ -1,978 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.formatting;
-
-import com.android.ide.common.xml.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings({
- "javadoc", "restriction"
-})
-public class EclipseXmlPrettyPrinterTest extends TestCase {
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- PreferenceStore store = new PreferenceStore();
- AdtPrefs.init(store);
- AdtPrefs prefs = AdtPrefs.getPrefs();
- prefs.initializeStoreWithDefaults(store);
- prefs.loadValues(null);
- EclipseXmlFormatPreferences formatPrefs = EclipseXmlFormatPreferences.create();
- assertTrue(formatPrefs.oneAttributeOnFirstLine);
- }
-
- private void checkFormat(EclipseXmlFormatPreferences prefs, String baseLocation,
- String xml,
- String expected, String delimiter, String startNodeName,
- boolean openTagOnly, String endNodeName) throws Exception {
-
- IStructuredModel model = DomUtilities.createStructuredModel(xml);
- assertNotNull(model);
- model.setBaseLocation(baseLocation);
- Document document = null;
- if (model instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) model;
- document = domModel.getDocument();
- } else {
- fail("Can't get DOM model");
- return;
- }
- XmlFormatStyle style = AndroidXmlFormattingStrategy.guessStyle(model, document);
-
- EclipseXmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(prefs, style, delimiter);
- printer.setEndWithNewline(xml.endsWith("\n"));
-
- StringBuilder sb = new StringBuilder(1000);
- Node startNode = document;
- Node endNode = document;
- if (startNodeName != null) {
- startNode = findNode(document.getDocumentElement(), startNodeName);
- }
- if (endNodeName != null) {
- endNode = findNode(document.getDocumentElement(), endNodeName);
- }
-
- printer.prettyPrint(-1, document, startNode, endNode, sb, false/*openTagOnly*/);
- String formatted = sb.toString();
- if (!expected.equals(formatted)) {
- System.out.println(formatted);
- }
- assertEquals(expected, formatted);
- }
-
- private Node findNode(Node node, String nodeName) {
- if (node.getNodeName().equals(nodeName)) {
- return node;
- }
-
- NodeList children = node.getChildNodes();
- for (int i = 0, n = children.getLength(); i < n; i++) {
- Node child = children.item(i);
- Node result = findNode(child, nodeName);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-
- protected int getCaretOffset(String fileContent, String caretLocation) {
- int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
- assertTrue(caretLocation, caretDelta != -1);
-
- String 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;
- }
-
- private void checkFormat(EclipseXmlFormatPreferences prefs, String baseLocation, String xml,
- String expected, String delimiter) throws Exception {
- checkFormat(prefs, baseLocation, xml, expected, delimiter, null, false, null);
- }
-
- private void checkFormat(EclipseXmlFormatPreferences prefs, String baseLocation, String xml,
- String expected) throws Exception {
- checkFormat(prefs, baseLocation, xml, expected, "\n"); //$NON-NLS-1$
- }
- private void checkFormat(String baseLocation, String xml, String expected)
- throws Exception {
- EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
- checkFormat(prefs, baseLocation, xml, expected);
- }
-
- public void testLayout1() throws Exception {
- checkFormat(
- "res/layout-port/layout1.xml",
- "<LinearLayout><Button></Button></LinearLayout>",
-
- "<LinearLayout>\n" +
- "\n" +
- " <Button>\n" +
- " </Button>\n" +
- "\n" +
- "</LinearLayout>");
- }
-
- public void testLayout2() throws Exception {
- checkFormat(
- "res/layout-port/layout2.xml",
- "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
-
- "<LinearLayout>\n" +
- "\n" +
- " <Button foo=\"bar\" >\n" +
- " </Button>\n" +
- "\n" +
- "</LinearLayout>");
- }
-
- public void testLayout3() throws Exception {
- EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
- prefs.oneAttributeOnFirstLine = true;
- checkFormat(
- prefs, "res/layout-land/layout3.xml",
- "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
-
- "<LinearLayout>\n" +
- "\n" +
- " <Button foo=\"bar\" >\n" +
- " </Button>\n" +
- "\n" +
- "</LinearLayout>");
- }
-
- public void testClosedElements() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<resources>\n" +
- "<item name=\"title_container\" type=\"id\" />\n" +
- "<item name=\"title_logo\" type=\"id\"/>\n" +
- "</resources>\n",
-
- "<resources>\n" +
- "\n" +
- " <item name=\"title_container\" type=\"id\"/>\n" +
- " <item name=\"title_logo\" type=\"id\"/>\n" +
- "\n" +
- "</resources>\n");
- }
-
- public void testResources() throws Exception {
- checkFormat(
- "res/values-us/strings.xml",
- "<resources><item name=\"foo\">Text value here </item></resources>",
- "<resources>\n\n" +
- " <item name=\"foo\">Text value here </item>\n" +
- "\n</resources>");
- }
-
- public void testNodeTypes() throws Exception {
- // Ensures that a document with all kinds of node types is serialized correctly
- checkFormat(
- "res/layout-xlarge/layout.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<!--\n" +
- "/**\n" +
- " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
- " */\n" +
- "-->\n" +
- "<!DOCTYPE metadata [\n" +
- "<!ELEMENT metadata (category)*>\n" +
- "<!ENTITY % ISOLat2\n" +
- " SYSTEM \"http://www.xml.com/iso/isolat2-xml.entities\" >\n" +
- "]>\n" +
- "<LinearLayout\n" +
- " xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:orientation=\"vertical\">\n" +
- "<![CDATA[\n" +
- "This is character data!\n" +
- "<!-- This is not a comment! -->\n" +
- "and <this is not an element>\n" +
- "]]> \n" +
- "This is text: &lt; and &amp;\n" +
- "<!-- comment 1 \"test\"... -->\n" +
- "<!-- ... comment2 -->\n" +
- "%ISOLat2; \n" +
- "<!-- \n" +
- "Type <key>less-than</key> (&#x3C;)\n" +
- "--> \n" +
- "</LinearLayout>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<!--\n" +
- "/**\n" +
- " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
- " */\n" +
- "-->\n" +
- "<!DOCTYPE metadata [\n" +
- "<!ELEMENT metadata (category)*>\n" +
- "<!ENTITY % ISOLat2\n" +
- " SYSTEM \"http://www.xml.com/iso/isolat2-xml.entities\" >\n" +
- "]>\n" +
- "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:orientation=\"vertical\" >\n" +
- "<![CDATA[\n" +
- "This is character data!\n" +
- "<!-- This is not a comment! -->\n" +
- "and <this is not an element>\n" +
- "]]>\n" +
- "This is text: &lt; and &amp;\n" +
- " <!-- comment 1 \"test\"... -->\n" +
- " <!-- ... comment2 -->\n" +
- "%ISOLat2; \n" +
- "<!-- Type <key>less-than</key> (&#x3C;) -->\n" +
- "\n" +
- "</LinearLayout>");
- }
-
- public void testWindowsDelimiters() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
- "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
-
- "<LinearLayout>\r\n" +
- "\r\n" +
- " <Button foo=\"bar\" >\r\n" +
- " </Button>\r\n" +
- "\r\n" +
- "</LinearLayout>",
- "\r\n");
- }
-
- public void testRemoveBlanklines() throws Exception {
- EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
- prefs.removeEmptyLines = true;
- checkFormat(
- prefs, "res/layout-xlarge/layout.xml",
- "<foo><bar><baz1></baz1><baz2></baz2></bar><bar2></bar2><bar3><baz12></baz12></bar3></foo>",
-
- "<foo>\n" +
- " <bar>\n" +
- " <baz1>\n" +
- " </baz1>\n" +
- " <baz2>\n" +
- " </baz2>\n" +
- " </bar>\n" +
- " <bar2>\n" +
- " </bar2>\n" +
- " <bar3>\n" +
- " <baz12>\n" +
- " </baz12>\n" +
- " </bar3>\n" +
- "</foo>");
- }
-
- public void testRange() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
- "<LinearLayout><Button foo=\"bar\"></Button><CheckBox/></LinearLayout>",
- "\n" +
- " <Button foo=\"bar\" >\n" +
- " </Button>\n" +
- "\n" +
- " <CheckBox />\n",
- "\n",
- "Button", false, "CheckBox");
- }
-
- public void testOpenTagOnly() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
- "<LinearLayout><Button foo=\"bar\"></Button><CheckBox/></LinearLayout>",
- "\n" +
- " <Button foo=\"bar\" >\n" +
- " </Button>\n",
- "\n",
-
- "Button", true, "Button");
- }
-
- public void testRange2() throws Exception {
- EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
- prefs.removeEmptyLines = true;
- checkFormat(
- prefs, "res/layout-xlarge/layout.xml",
- "<foo><bar><baz1></baz1><baz2></baz2></bar><bar2></bar2><bar3><baz12></baz12></bar3></foo>",
-
- " <baz1>\n" +
- " </baz1>\n" +
- " <baz2>\n" +
- " </baz2>\n" +
- " </bar>\n" +
- " <bar2>\n" +
- " </bar2>\n" +
- " <bar3>\n" +
- " <baz12>\n" +
- " </baz12>\n",
- "\n",
- "baz1", false, "baz12");
- }
-
- public void testEOLcomments() throws Exception {
- checkFormat(
- "res/drawable-mdpi/states.xml",
- "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
- " <item android:state_pressed=\"true\"\n" +
- " android:color=\"#ffff0000\"/> <!-- pressed -->\n" +
- " <item android:state_focused=\"true\"\n" +
- " android:color=\"#ff0000ff\"/> <!-- focused -->\n" +
- " <item android:color=\"#ff000000\"/> <!-- default -->\n" +
- "</selector>",
- "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
- "\n" +
- " <item android:state_pressed=\"true\" android:color=\"#ffff0000\"/> <!-- pressed -->\n" +
- " <item android:state_focused=\"true\" android:color=\"#ff0000ff\"/> <!-- focused -->\n" +
- " <item android:color=\"#ff000000\"/> <!-- default -->\n" +
- "\n" +
- "</selector>");
- }
-
- public void testFormatColorList() throws Exception {
- checkFormat(
- "res/drawable-hdpi/states.xml",
- "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
- "<item android:state_activated=\"true\" android:color=\"#FFFFFF\"/>\n" +
- "<item android:color=\"#777777\" /> <!-- not selected -->\n" +
- "</selector>",
- "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
- "\n" +
- " <item android:state_activated=\"true\" android:color=\"#FFFFFF\"/>\n" +
- " <item android:color=\"#777777\"/> <!-- not selected -->\n" +
- "\n" +
- "</selector>");
- }
-
- public void testPreserveNewlineAfterComment() throws Exception {
- checkFormat(
- "res/values/dimen.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources><dimen name=\"colorstrip_height\">6dip</dimen>\n" +
- " <!-- comment1 --><dimen name=\"title_height\">45dip</dimen>\n" +
- "\n" +
- " <!-- comment2: newline above --><dimen name=\"now_playing_height\">90dip</dimen>\n" +
- " <dimen name=\"text_size_small\">14sp</dimen>\n" +
- "\n" +
- "\n" +
- " <!-- comment3: newline above and below -->\n" +
- "\n" +
- "\n" +
- "\n" +
- " <dimen name=\"text_size_medium\">18sp</dimen><dimen name=\"text_size_large\">22sp</dimen>\n" +
- "</resources>",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
- " <!-- comment1 -->\n" +
- " <dimen name=\"title_height\">45dip</dimen>\n" +
- "\n" +
- " <!-- comment2: newline above -->\n" +
- " <dimen name=\"now_playing_height\">90dip</dimen>\n" +
- " <dimen name=\"text_size_small\">14sp</dimen>\n" +
- "\n" +
- " <!-- comment3: newline above and below -->\n" +
- "\n" +
- " <dimen name=\"text_size_medium\">18sp</dimen>\n" +
- " <dimen name=\"text_size_large\">22sp</dimen>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testPlurals() throws Exception {
- checkFormat(
- "res/values-us/strings.xml",
- "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n" +
- "<string name=\"toast_sync_error\">Sync error: <xliff:g id=\"error\">%1$s</xliff:g></string>\n" +
- "<string name=\"session_subtitle\"><xliff:g id=\"time\">%1$s</xliff:g> in <xliff:g id=\"room\">%2$s</xliff:g></string>\n" +
- "<plurals name=\"now_playing_countdown\">\n" +
- "<item quantity=\"zero\"><xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
- "<item quantity=\"one\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> day, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
- "<item quantity=\"other\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> days, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
- "</plurals>\n" +
- "</resources>",
- "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n" +
- "\n" +
- " <string name=\"toast_sync_error\">Sync error: <xliff:g id=\"error\">%1$s</xliff:g></string>\n" +
- " <string name=\"session_subtitle\"><xliff:g id=\"time\">%1$s</xliff:g> in <xliff:g id=\"room\">%2$s</xliff:g></string>\n" +
- "\n" +
- " <plurals name=\"now_playing_countdown\">\n" +
- " <item quantity=\"zero\"><xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
- " <item quantity=\"one\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> day, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
- " <item quantity=\"other\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> days, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
- " </plurals>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testMultiAttributeResource() throws Exception {
- checkFormat(
- "res/values-us/strings.xml",
- "<resources><string name=\"debug_enable_debug_logging_label\" translatable=\"false\">Enable extra debug logging?</string></resources>",
- "<resources>\n" +
- "\n" +
- " <string name=\"debug_enable_debug_logging_label\" translatable=\"false\">Enable extra debug logging?</string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testMultilineCommentAlignment() throws Exception {
- checkFormat(
- "res/values-us/strings.xml",
- "<resources>" +
- " <!-- Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,\n" +
- " and remove the actual text. These will be removed in a bulk operation. -->\n" +
- " <!-- Do Not Translate. Unused string. -->\n" +
- " <string name=\"meeting_invitation\"></string>\n" +
- "</resources>",
- "<resources>\n" +
- "\n" +
- " <!--\n" +
- " Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,\n" +
- " and remove the actual text. These will be removed in a bulk operation.\n" +
- " -->\n" +
- " <!-- Do Not Translate. Unused string. -->\n" +
- " <string name=\"meeting_invitation\"></string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testLineCommentSpacing() throws Exception {
- checkFormat(
- "res/values-us/strings.xml",
- "<resources>\n" +
- "\n" +
- " <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
- " <!-- comment1 -->\n" +
- " <dimen name=\"title_height\">45dip</dimen>\n" +
- " <!-- comment2: no newlines -->\n" +
- " <dimen name=\"now_playing_height\">90dip</dimen>\n" +
- " <dimen name=\"text_size_small\">14sp</dimen>\n" +
- "\n" +
- " <!-- comment3: newline above and below -->\n" +
- "\n" +
- " <dimen name=\"text_size_medium\">18sp</dimen>\n" +
- " <dimen name=\"text_size_large\">22sp</dimen>\n" +
- "\n" +
- "</resources>",
-
- "<resources>\n" +
- "\n" +
- " <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
- " <!-- comment1 -->\n" +
- " <dimen name=\"title_height\">45dip</dimen>\n" +
- " <!-- comment2: no newlines -->\n" +
- " <dimen name=\"now_playing_height\">90dip</dimen>\n" +
- " <dimen name=\"text_size_small\">14sp</dimen>\n" +
- "\n" +
- " <!-- comment3: newline above and below -->\n" +
- "\n" +
- " <dimen name=\"text_size_medium\">18sp</dimen>\n" +
- " <dimen name=\"text_size_large\">22sp</dimen>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testCommentHandling() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/layout/layout1.xml",
- "<foo >\n" +
- "\n" +
- " <!-- abc\n" +
- " def\n" +
- " ghi -->\n" +
- "\n" +
- " <!-- abc\n" +
- " def\n" +
- " ghi -->\n" +
- " \n" +
- "<!-- abc\n" +
- "def\n" +
- "ghi -->\n" +
- "\n" +
- "</foo>",
-
- "<foo>\n" +
- "\n" +
- " <!--\n" +
- " abc\n" +
- " def\n" +
- " ghi\n" +
- " -->\n" +
- "\n" +
- "\n" +
- " <!--\n" +
- " abc\n" +
- " def\n" +
- " ghi\n" +
- " -->\n" +
- "\n" +
- "\n" +
- " <!--\n" +
- "abc\n" +
- "def\n" +
- "ghi\n" +
- " -->\n" +
- "\n" +
- "</foo>");
- }
-
- public void testCommentHandling2() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
- "<foo >\n" +
- " <!-- multi -->\n" +
- "\n" +
- " <bar />\n" +
- "</foo>",
-
- "<foo>\n" +
- "\n" +
- " <!-- multi -->\n" +
- "\n" +
- " <bar />\n" +
- "\n" +
- "</foo>");
- }
-
- public void testMenus1() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/menu/menu1.xml",
- // http://code.google.com/p/android/issues/detail?id=21383
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
- "\n" +
- " <item\n" +
- " android:id=\"@+id/menu_debug\"\n" +
- " android:icon=\"@android:drawable/ic_menu_more\"\n" +
- " android:showAsAction=\"ifRoom|withText\"\n" +
- " android:title=\"@string/menu_debug\">\n" +
- " \n" +
- " <menu>\n" +
- " <item\n" +
- " android:id=\"@+id/menu_debug_clearCache_memory\"\n" +
- " android:icon=\"@android:drawable/ic_menu_delete\"\n" +
- " android:showAsAction=\"ifRoom|withText\"\n" +
- " android:title=\"@string/menu_debug_clearCache_memory\"/>\n" +
- " \n" +
- " <item\n" +
- " android:id=\"@+id/menu_debug_clearCache_file\"\n" +
- " android:icon=\"@android:drawable/ic_menu_delete\"\n" +
- " android:showAsAction=\"ifRoom|withText\"\n" +
- " android:title=\"@string/menu_debug_clearCache_file\"/>\n" +
- " </menu>\n" +
- " </item>\n" +
- "</menu>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
- "\n" +
- " <item\n" +
- " android:id=\"@+id/menu_debug\"\n" +
- " android:icon=\"@android:drawable/ic_menu_more\"\n" +
- " android:showAsAction=\"ifRoom|withText\"\n" +
- " android:title=\"@string/menu_debug\">\n" +
- " <menu>\n" +
- " <item\n" +
- " android:id=\"@+id/menu_debug_clearCache_memory\"\n" +
- " android:icon=\"@android:drawable/ic_menu_delete\"\n" +
- " android:showAsAction=\"ifRoom|withText\"\n" +
- " android:title=\"@string/menu_debug_clearCache_memory\"/>\n" +
- " <item\n" +
- " android:id=\"@+id/menu_debug_clearCache_file\"\n" +
- " android:icon=\"@android:drawable/ic_menu_delete\"\n" +
- " android:showAsAction=\"ifRoom|withText\"\n" +
- " android:title=\"@string/menu_debug_clearCache_file\"/>\n" +
- " </menu>\n" +
- " </item>\n" +
- "\n" +
- "</menu>");
- }
-
- public void testMenus2() throws Exception {
- EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
- prefs.removeEmptyLines = true;
- checkFormat(
- prefs, "res/drawable-hdpi/layerlist.xml",
- // http://code.google.com/p/android/issues/detail?id=21346
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
- " <item>\n" +
- " <shape android:shape=\"rectangle\">\n" +
- " <stroke\n" +
- " android:width=\"1dip\"\n" +
- " android:color=\"@color/line_separator\"/>\n" +
- " <solid android:color=\"@color/event_header_background\"/>\n" +
- " </shape>\n" +
- " </item>\n" +
- " <item\n" +
- " android:bottom=\"1dip\"\n" +
- " android:top=\"1dip\">\n" +
- " <shape android:shape=\"rectangle\">\n" +
- " <stroke\n" +
- " android:width=\"1dip\"\n" +
- " android:color=\"@color/event_header_background\"/>\n" +
- " <solid android:color=\"@color/transparent\"/>\n" +
- " </shape>\n" +
- " </item>\n" +
- "</layer-list>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
- " <item>\n" +
- " <shape android:shape=\"rectangle\" >\n" +
- " <stroke\n" +
- " android:width=\"1dip\"\n" +
- " android:color=\"@color/line_separator\" />\n" +
- " <solid android:color=\"@color/event_header_background\" />\n" +
- " </shape>\n" +
- " </item>\n" +
- " <item\n" +
- " android:bottom=\"1dip\"\n" +
- " android:top=\"1dip\">\n" +
- " <shape android:shape=\"rectangle\" >\n" +
- " <stroke\n" +
- " android:width=\"1dip\"\n" +
- " android:color=\"@color/event_header_background\" />\n" +
- " <solid android:color=\"@color/transparent\" />\n" +
- " </shape>\n" +
- " </item>\n" +
- "</layer-list>");
- }
-
- public void testMenus3() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/menu/menu1.xml",
- // http://code.google.com/p/android/issues/detail?id=21227
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
- "\n" +
- " <item\n" +
- " android:icon=\"@android:drawable/ic_menu_more\"\n" +
- " android:title=\"@string/account_list_menu_more\">\n" +
- " <menu>\n" +
- " <item\n" +
- " android:id=\"@+id/account_list_menu_backup_restore\"\n" +
- " android:icon=\"@android:drawable/ic_menu_save\"\n" +
- " android:title=\"@string/account_list_menu_backup_restore\"/>\n" +
- " </menu>\n" +
- " </item>\n" +
- "\n" +
- "</menu>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
- "\n" +
- " <item\n" +
- " android:icon=\"@android:drawable/ic_menu_more\"\n" +
- " android:title=\"@string/account_list_menu_more\">\n" +
- " <menu>\n" +
- " <item\n" +
- " android:id=\"@+id/account_list_menu_backup_restore\"\n" +
- " android:icon=\"@android:drawable/ic_menu_save\"\n" +
- " android:title=\"@string/account_list_menu_backup_restore\"/>\n" +
- " </menu>\n" +
- " </item>\n" +
- "\n" +
- "</menu>");
-
- }
-
- public void testColors1() throws Exception {
- checkFormat(
- EclipseXmlFormatPreferences.create(), "res/values/colors.xml",
- "<resources>\n" +
- " <color name=\"enrollment_error\">#99e21f14</color>\n" +
- "\n" +
- " <color name=\"service_starting_up\">#99000000</color>\n" +
- "</resources>",
-
- "<resources>\n" +
- "\n" +
- " <color name=\"enrollment_error\">#99e21f14</color>\n" +
- " <color name=\"service_starting_up\">#99000000</color>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testEclipseFormatStyle1() throws Exception {
- EclipseXmlFormatPreferences prefs = new EclipseXmlFormatPreferences() {
- @Override
- public String getOneIndentUnit() {
- return "\t";
- }
-
- @Override
- public int getTabWidth() {
- return 8;
- }
- };
- checkFormat(
- prefs, "res/values/colors.xml",
- "<resources>\n" +
- " <color name=\"enrollment_error\">#99e21f14</color>\n" +
- "\n" +
- " <color name=\"service_starting_up\">#99000000</color>\n" +
- "</resources>",
-
- "<resources>\n" +
- "\n" +
- "\t<color name=\"enrollment_error\">#99e21f14</color>\n" +
- "\t<color name=\"service_starting_up\">#99000000</color>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testEclipseFormatStyle2() throws Exception {
- EclipseXmlFormatPreferences prefs = new EclipseXmlFormatPreferences() {
- @Override
- public String getOneIndentUnit() {
- return " ";
- }
-
- @Override
- public int getTabWidth() {
- return 2;
- }
- };
- prefs.useEclipseIndent = true;
- checkFormat(
- prefs, "res/values/colors.xml",
- "<resources>\n" +
- " <color name=\"enrollment_error\">#99e21f14</color>\n" +
- "\n" +
- " <color name=\"service_starting_up\">#99000000</color>\n" +
- "</resources>",
-
- "<resources>\n" +
- "\n" +
- " <color name=\"enrollment_error\">#99e21f14</color>\n" +
- " <color name=\"service_starting_up\">#99000000</color>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testNameSorting() throws Exception {
- checkFormat(
- "res/values/dimen.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- " <attr format=\"integer\" name=\"no\" />\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <attr name=\"no\" format=\"integer\" />\n" +
- "\n" +
- "</resources>");
- }
-
- public void testStableText() throws Exception {
- checkFormat(
- "res/layout/stable.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:orientation=\"vertical\">\n" +
- " Hello World\n" +
- "\n" +
- "</LinearLayout>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:orientation=\"vertical\" >\n" +
- " Hello World\n" +
- "\n" +
- "</LinearLayout>");
- }
-
- public void testResources1() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"test_string\">a\n" +
- " </string>\n" +
- "\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"test_string\">a</string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testMarkup() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- "<string name=\"welcome\">Welcome to <b>Android</b>!</string>" +
- "<string name=\"glob_settings_top_text\"><b>To install a 24 Clock Widget, " +
- "please <i>long press</i> in Home Screen.</b> Configure the Global Settings " +
- "here.</string>" +
- "" +
- "\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"welcome\">Welcome to <b>Android</b>!</string>\n" +
- " <string name=\"glob_settings_top_text\"><b>To install a 24 Clock Widget, " +
- "please <i>long press</i> in Home Screen.</b> Configure the Global Settings " +
- "here.</string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testPreserveEntities() throws Exception {
- // Ensure that entities such as &gt; in the input string are preserved in the output
- // format
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources><string name=\"untitled\">&lt;untitled2></string>\n" +
- "<string name=\"untitled2\">&lt;untitled2&gt;</string>\n" +
- "<string name=\"untitled3\">&apos;untitled3&quot;</string></resources>\n",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"untitled\">&lt;untitled2></string>\n" +
- " <string name=\"untitled2\">&lt;untitled2&gt;</string>\n" +
- " <string name=\"untitled3\">&apos;untitled3&quot;</string>\n" +
- "\n" +
- "</resources>\n");
- }
-
- public void testCData1() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- " <string name=\"foo\"><![CDATA[bar]]></string>\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"foo\"><![CDATA[bar]]></string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testCData2() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- " <string name=\"foo1\"><![CDATA[bar1\n" +
- "bar2\n" +
- "bar3]]></string>\n" +
- " <string name=\"foo2\"><![CDATA[bar]]></string>\n" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"foo1\">\n" +
- "<![CDATA[bar1\n" +
- "bar2\n" +
- "bar3]]>\n" +
- " </string>\n" +
- " <string name=\"foo2\"><![CDATA[bar]]></string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void testComplexString() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "<string name=\"progress_completed_export_all\">The database has " +
- "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
- "\\\"<i>%s</i>\\\"</font></string>" +
- "</resources>",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"progress_completed_export_all\">The database has " +
- "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
- "\\\"<i>%s</i>\\\"</font></string>\n" +
- "\n" +
- "</resources>");
- }
-
- public void test52887() throws Exception {
- // https://code.google.com/p/android/issues/detail?id=52887
- checkFormat(
- "res/layout/relative.xml",
-
- "<!--Comment-->\n" +
- "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"/>\n",
-
- "<!-- Comment -->\n" +
- "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\" />\n");
- }
-
- public void testPreserveLastNewline() throws Exception {
- checkFormat(
- "res/values/strings.xml",
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "<string name=\"progress_completed_export_all\">The database has " +
- "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
- "\\\"<i>%s</i>\\\"</font></string>" +
- "</resources>\n",
-
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<resources>\n" +
- "\n" +
- " <string name=\"progress_completed_export_all\">The database has " +
- "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
- "\\\"<i>%s</i>\\\"</font></string>\n" +
- "\n" +
- "</resources>\n");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
deleted file mode 100644
index c71064eba..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.gle2;
-
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ID_PREFIX;
-import static com.android.SdkConstants.NEW_ID_PREFIX;
-import static com.android.SdkConstants.TOOLS_PREFIX;
-import static com.android.SdkConstants.TOOLS_URI;
-
-import com.android.ide.common.layout.BaseLayoutRule;
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-import com.android.utils.Pair;
-import com.android.utils.XmlUtils;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- *
- */
-@SuppressWarnings({"restriction", "javadoc", "deprecation"}) // XML DOM model
-public class LayoutMetadataTest extends AdtProjectTest {
-
- public void testMetadata1() throws Exception {
- Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "listView1");
- UiElementNode uiNode = pair.getSecond();
- Node node = uiNode.getXmlNode();
-
- assertNull(LayoutMetadata.getProperty(node, "foo"));
-
- Element element = (Element) node;
- String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null, false);
- if (prefix == null) {
- // Add in new prefix...
- prefix = XmlUtils.lookupNamespacePrefix(element,
- TOOLS_URI, TOOLS_PREFIX, true);
- }
- element.setAttribute(prefix + ':' + "foo", "bar");
- }
-
- // ==== Test utilities ====
-
- private static String getText(IDocument document, Node node) throws Exception {
- IndexedRegion region = (IndexedRegion) node;
- // This often returns the wrong value:
- //int length = region.getLength();
- int length = region.getEndOffset() - region.getStartOffset();
- return document.get(region.getStartOffset(), length);
- }
-
- private Pair<IDocument, UiElementNode> getNode(String filename, String targetId)
- throws Exception, PartInitException {
- IFile file = getLayoutFile(getProject(), filename);
- AdtPlugin.openFile(file, null);
- IEditorPart newEditor = AdtUtils.getActiveEditor();
- assertTrue(newEditor instanceof AndroidXmlEditor);
- AndroidXmlEditor xmlEditor = (AndroidXmlEditor) newEditor;
- IStructuredDocument document = xmlEditor.getStructuredDocument();
- UiElementNode root = xmlEditor.getUiRootNode();
- assertNotNull(root);
- UiElementNode node = findById(root, targetId);
- assertNotNull(node);
- Pair<IDocument, UiElementNode> pair = Pair.<IDocument, UiElementNode>of(document, node);
- return pair;
- }
-
- private static UiElementNode findById(UiElementNode node, String targetId) {
- assertFalse(targetId.startsWith(NEW_ID_PREFIX));
- assertFalse(targetId.startsWith(ID_PREFIX));
-
- String id = node.getAttributeValue(ATTR_ID);
- if (id != null && targetId.equals(BaseLayoutRule.stripIdPrefix(id))) {
- return node;
- }
-
- for (UiElementNode child : node.getUiChildren()) {
- UiElementNode result = findById(child, targetId);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-}
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
deleted file mode 100644
index 9c48ccdad..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-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.ide.common.sdk.LoadStatus;
-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;
-import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors;
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
-import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
-import com.android.ide.eclipse.adt.internal.sdk.Sdk;
-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.SdkLoadingTestCase;
-import com.android.sdklib.IAndroidTarget;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.ByteArrayInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@SuppressWarnings({"restriction", "javadoc"})
-public abstract class AdtProjectTest extends SdkLoadingTestCase {
- private static final int TARGET_API_LEVEL = 16;
- public static final String TEST_PROJECT_PACKAGE = "com.android.eclipse.tests"; //$NON-NLS-1$
- private static final long TESTS_START_TIME = System.currentTimeMillis();
- 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
- * can share a single project instance (which is typically much faster).
- * However, see {@link #getProjectName()} for exceptions to this sharing scheme.
- */
- 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();
-
- // Prevent preview icon computation during plugin test to make test faster
- if (AdtPlugin.getDefault() == null) {
- fail("This test must be run as an Eclipse plugin test, not a plain JUnit test!");
- }
- AdtPrefs.getPrefs().setPaletteModes("ICON_TEXT"); //$NON-NLS-1$
-
- getProject();
-
- Sdk current = Sdk.getCurrent();
- assertNotNull(current);
- LoadStatus sdkStatus = AdtPlugin.getDefault().getSdkLoadStatus();
- assertSame(LoadStatus.LOADED, sdkStatus);
- IAndroidTarget target = current.getTarget(getProject());
- IJavaProject javaProject = BaseProjectHelper.getJavaProject(getProject());
- assertNotNull(javaProject);
- int iterations = 0;
- while (true) {
- if (iterations == 100) {
- fail("Couldn't load target; ran out of time");
- }
- LoadStatus status = current.checkAndLoadTargetData(target, javaProject);
- if (status == LoadStatus.FAILED) {
- fail("Couldn't load target " + target);
- }
- if (status != LoadStatus.LOADING) {
- break;
- }
- Thread.sleep(250);
- iterations++;
- }
- AndroidTargetData targetData = current.getTargetData(target);
- assertNotNull(targetData);
- LayoutDescriptors layoutDescriptors = targetData.getLayoutDescriptors();
- assertNotNull(layoutDescriptors);
- List<ViewElementDescriptor> viewDescriptors = layoutDescriptors.getViewDescriptors();
- assertNotNull(viewDescriptors);
- assertTrue(viewDescriptors.size() > 0);
- List<ViewElementDescriptor> layoutParamDescriptors =
- layoutDescriptors.getLayoutDescriptors();
- assertNotNull(layoutParamDescriptors);
- assertTrue(layoutParamDescriptors.size() > 0);
- }
-
- /** Set to true if the subclass test case should use a per-instance project rather
- * than a shared project. This is needed by projects which modify the project in such
- * a way that it affects what other tests see (for example, the quickfix resource creation
- * tests will add in new resources, which the code completion tests will then list as
- * possible matches if the code completion test is run after the quickfix test.)
- * @return true to create a per-instance project instead of the default shared project
- */
- protected boolean testCaseNeedsUniqueProject() {
- return false;
- }
-
- protected boolean testNeedsUniqueProject() {
- return false;
- }
-
- @Override
- protected boolean validateSdk(IAndroidTarget target) {
- // Not quite working yet. When enabled will make tests run faster.
- //if (target.getVersion().getApiLevel() < TARGET_API_LEVEL) {
- // return false;
- //}
-
- return true;
- }
-
- /** Returns a name to use for the project used in this test. Subclasses do not need to
- * override this if they can share a project with others - which is the case if they do
- * not modify the project in a way that does not affect other tests. For example
- * the resource quickfix test will create new resources which affect what shows up
- * in the code completion results, so the quickfix tests will override this method
- * to produce a unique project for its own tests.
- */
- private String getProjectName() {
- if (testNeedsUniqueProject()) {
- return PROJECTNAME_PREFIX + getClass().getSimpleName() + "-" + getName();
- } else if (testCaseNeedsUniqueProject()) {
- return PROJECTNAME_PREFIX + getClass().getSimpleName();
- } else {
- return PROJECTNAME_PREFIX + TESTS_START_TIME;
- }
- }
-
- protected IProject getProject() {
- String projectName = getProjectName();
- IProject project = sProjectMap.get(projectName);
- if (project == null) {
- project = createProject(projectName);
- assertNotNull(project);
- sProjectMap.put(projectName, project);
- }
- if (!testCaseNeedsUniqueProject() && !testNeedsUniqueProject()) {
- addCleanupDir(AdtUtils.getAbsolutePath(project).toFile());
- }
- addCleanupDir(project.getFullPath().toFile());
- return project;
- }
-
- protected IFile getTestDataFile(IProject project, String name) throws Exception {
- return getTestDataFile(project, name, name);
- }
-
- protected IFile getLayoutFile(IProject project, String name) throws Exception {
- return getTestDataFile(project, name, FD_RES + "/" + FD_RES_LAYOUT + "/" + name);
- }
-
- protected IFile getValueFile(IProject project, String name) throws Exception {
- return getTestDataFile(project, name, FD_RES + "/" + FD_RES_VALUES + "/" + name);
- }
-
- protected IFile getTestDataFile(IProject project, String sourceName,
- String destPath) throws Exception {
- return getTestDataFile(project, sourceName, destPath, false);
- }
-
- protected IFile getTestDataFile(IProject project, String sourceName,
- String destPath, boolean overwrite) throws Exception {
- String[] split = destPath.split("/"); //$NON-NLS-1$
- IContainer parent;
- String name;
- if (split.length == 1) {
- parent = project;
- name = destPath;
- } else {
- IFolder folder = project.getFolder(split[0]);
- NullProgressMonitor monitor = new NullProgressMonitor();
- if (!folder.exists()) {
- folder.create(true /* force */, true /* local */, monitor);
- }
- for (int i = 1, n = split.length; i < n -1; i++) {
- IFolder subFolder = folder.getFolder(split[i]);
- if (!subFolder.exists()) {
- subFolder.create(true /* force */, true /* local */, monitor);
- }
- folder = subFolder;
- }
- name = split[split.length - 1];
- parent = folder;
- }
- IFile file = parent.getFile(new Path(name));
- if (overwrite && file.exists()) {
- String currentContents = AdtPlugin.readFile(file);
- String newContents = readTestFile(sourceName, true);
- if (currentContents == null || !currentContents.equals(newContents)) {
- file.delete(true, new NullProgressMonitor());
- } else {
- return file;
- }
- }
- if (!file.exists()) {
- String xml = readTestFile(sourceName, true);
- InputStream bstream = new ByteArrayInputStream(xml.getBytes("UTF-8")); //$NON-NLS-1$
- NullProgressMonitor monitor = new NullProgressMonitor();
- file.create(bstream, false /* force */, monitor);
- }
-
- return file;
- }
-
- protected IProject createProject(String name) {
- IAndroidTarget target = null;
-
- IAndroidTarget[] targets = getSdk().getTargets();
- for (IAndroidTarget t : targets) {
- if (!t.isPlatform()) {
- continue;
- }
- if (t.getVersion().getApiLevel() >= TARGET_API_LEVEL) {
- target = t;
- break;
- }
- }
- assertNotNull(target);
-
- IRunnableContext context = new IRunnableContext() {
- @Override
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
- throws InvocationTargetException, InterruptedException {
- runnable.run(new NullProgressMonitor());
- }
- };
- NewProjectWizardState state = new NewProjectWizardState(Mode.ANY);
- state.projectName = name;
- state.target = target;
- state.packageName = TEST_PROJECT_PACKAGE;
- state.activityName = name;
- 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;
-
- IAndroidTarget[] targets = getSdk().getTargets();
- for (IAndroidTarget t : targets) {
- if (t.getVersion().getApiLevel() >= TARGET_API_LEVEL) {
- target = t;
- break;
- }
- }
- assertNotNull(target);
- }
-
- protected static IProject validateProjectExists(String name) {
- IProject iproject = getProject(name);
- assertTrue(String.format("%s project not created", name), iproject.exists());
- assertTrue(String.format("%s project not opened", name), iproject.isOpen());
- return iproject;
- }
-
- private static IProject getProject(String name) {
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- return iproject;
- }
-
- protected int getCaretOffset(IFile file, String caretLocation) {
- assertTrue(caretLocation, caretLocation.contains("^"));
-
- String fileContent = AdtPlugin.readFile(file);
- return getCaretOffset(fileContent, caretLocation);
- }
-
- /**
- * If the given caret location string contains a selection range, select that range in
- * the given viewer
- *
- * @param viewer the viewer to contain the selection
- * @param caretLocation the location string
- */
- protected int updateCaret(ISourceViewer viewer, String caretLocation) {
- assertTrue(caretLocation, caretLocation.contains("^")); //$NON-NLS-1$
-
- int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
- assertTrue(caretLocation, caretDelta != -1);
- String text = viewer.getTextWidget().getText();
-
- int length = 0;
-
- // 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);
- length = caretRangeEnd - caretDelta - 2;
- assertTrue(length > 0);
- 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 = text.indexOf(caretContext);
-
- assertTrue("Caret content " + caretContext + " not found in file",
- caretContextIndex != -1);
-
- int offset = caretContextIndex + caretDelta;
- viewer.setSelectedRange(offset, length);
-
- return offset;
- }
-
- protected String addSelection(String newFileContents, Point selectedRange) {
- int selectionBegin = selectedRange.x;
- int selectionEnd = selectionBegin + selectedRange.y;
- return addSelection(newFileContents, selectionBegin, selectionEnd);
- }
-
- @Override
- protected String removeSessionData(String data) {
- data = super.removeSessionData(data);
- if (getProject() != null) {
- data = data.replace(getProject().getName(), "PROJECTNAME");
- }
-
- return data;
- }
-
- public static ViewElementDescriptor createDesc(String name, String fqn, boolean hasChildren) {
- if (hasChildren) {
- return new ViewElementDescriptor(name, name, fqn, "", "", new AttributeDescriptor[0],
- new AttributeDescriptor[0], new ElementDescriptor[1], false);
- } else {
- return new ViewElementDescriptor(name, fqn);
- }
- }
-
- public static UiViewElementNode createNode(UiViewElementNode parent, String fqn,
- boolean hasChildren) {
- String name = fqn.substring(fqn.lastIndexOf('.') + 1);
- ViewElementDescriptor descriptor = createDesc(name, fqn, hasChildren);
- if (parent == null) {
- // All node hierarchies should be wrapped inside a document node at the root
- parent = new UiViewElementNode(createDesc("doc", "doc", true));
- }
- return (UiViewElementNode) parent.appendNewUiChild(descriptor);
- }
-
- public static UiViewElementNode createNode(String fqn, boolean hasChildren) {
- return createNode(null, fqn, hasChildren);
- }
-
- /** Special editor context set on the model to be rendered */
- protected static class TestLayoutEditorDelegate extends LayoutEditorDelegate {
-
- public TestLayoutEditorDelegate(
- IFile file,
- IStructuredDocument structuredDocument,
- UiDocumentNode uiRootNode) {
- super(new TestAndroidXmlCommonEditor(file, structuredDocument, uiRootNode));
- }
-
- static class TestAndroidXmlCommonEditor extends CommonXmlEditor {
-
- private final IFile mFile;
- private final IStructuredDocument mStructuredDocument;
- private UiDocumentNode mUiRootNode;
-
- TestAndroidXmlCommonEditor(
- IFile file,
- IStructuredDocument structuredDocument,
- UiDocumentNode uiRootNode) {
- mFile = file;
- mStructuredDocument = structuredDocument;
- mUiRootNode = uiRootNode;
- }
-
- @Override
- public IFile getInputFile() {
- return mFile;
- }
-
- @Override
- public IProject getProject() {
- return mFile.getProject();
- }
-
- @Override
- public IStructuredDocument getStructuredDocument() {
- return mStructuredDocument;
- }
-
- @Override
- public UiDocumentNode getUiRootNode() {
- return mUiRootNode;
- }
-
- @Override
- public void editorDirtyStateChanged() {
- }
-
- @Override
- public IStructuredModel getModelForRead() {
- IModelManager mm = StructuredModelManager.getModelManager();
- if (mm != null) {
- try {
- return mm.getModelForRead(mFile);
- } catch (Exception e) {
- fail(e.toString());
- }
- }
-
- return null;
- }
- }
- }
-
- public void testDummy() {
- // This class contains shared test functionality for testcase subclasses,
- // but without an actual test in the class JUnit complains (even if we make
- // it abstract)
- }
-}
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
deleted file mode 100644
index a716a75a3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import static com.android.SdkConstants.FQCN_GRID_LAYOUT;
-import static com.android.SdkConstants.FQCN_LINEAR_LAYOUT;
-import static com.android.SdkConstants.FQCN_RELATIVE_LAYOUT;
-
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.w3c.dom.Element;
-
-import java.util.Collections;
-import java.util.List;
-
-@SuppressWarnings("javadoc")
-public class ChangeLayoutRefactoringTest extends RefactoringTest {
-
- public void testChangeLayout1a() throws Exception {
- // Test a basic layout which performs some nesting -- tests basic grid layout conversion
- checkRefactoring("sample1a.xml", true);
- }
-
- public void testChangeLayout1b() throws Exception {
- // Same as 1a, but with different formatting to look for edit handling to for example
- // remove a line that is made empty when its only attribute is removed
- checkRefactoring("sample1b.xml", true);
- }
-
- public void testChangeLayout2() throws Exception {
- // Test code which analyzes an embedded RelativeLayout
- checkRefactoring("sample2.xml", true);
- }
-
- public void testChangeLayout3() throws Exception {
- // Test handling of LinearLayout "weight" attributes on its children: the child with
- // weight > 0 should fill and subsequent children attach on the bottom/right
- checkRefactoring("sample3.xml", true);
- }
-
- public void testChangeLayout4() throws Exception {
- checkRefactoring("sample4.xml", true);
- }
-
- public void testChangeLayout5() throws Exception {
- // Test handling of LinearLayout "gravity" attributes on its children
- checkRefactoring("sample5.xml", true);
- }
-
- public void testChangeLayout6() throws Exception {
- // Check handling of the LinearLayout "baseline" attribute
- checkRefactoring("sample6.xml", true);
- }
-
- public void testGridLayout1() throws Exception {
- checkRefactoring(FQCN_GRID_LAYOUT, "sample1a.xml", true);
- }
-
- public void testGridLayout2() throws Exception {
- // Test code which analyzes an embedded RelativeLayout
- checkRefactoring(FQCN_GRID_LAYOUT, "sample2.xml", true);
- }
-
- public void testGridLayout5() throws Exception {
- // Test handling of LinearLayout "gravity" attributes on its children
- checkRefactoring(FQCN_GRID_LAYOUT, "sample5.xml", true);
- }
-
- public void testConvertToGrid() throws Exception {
- checkRefactoring(FQCN_GRID_LAYOUT, "sample9.xml", true);
- }
-
- public void testConvertFromGrid() throws Exception {
- checkRefactoring(FQCN_LINEAR_LAYOUT, "sample10.xml", true);
- }
-
- private void checkRefactoring(String basename, boolean flatten) throws Exception {
- checkRefactoring(FQCN_RELATIVE_LAYOUT, basename, flatten);
- }
-
- public void testInitialAttributes() throws Exception {
- checkRefactoring(FQCN_LINEAR_LAYOUT, "sample10.xml", true, "android:orientation=vertical");
- }
-
- public void testInsertSpacer() throws Exception {
- checkRefactoring(FQCN_GRID_LAYOUT, "sample11.xml", true);
- }
-
- private void checkRefactoring(String newLayoutType, String basename,
- boolean flatten) throws Exception {
- 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);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- CanvasViewInfo rootView = info.mRootView;
- Element element = info.mElement;
-
- List<Element> selectedElements = Collections.singletonList(element);
- ChangeLayoutRefactoring refactoring = new ChangeLayoutRefactoring(selectedElements,
- layoutEditor);
- refactoring.setFlatten(flatten);
- refactoring.setType(newLayoutType);
- if (initialAttributes != null) {
- refactoring.setInitializedAttributes(initialAttributes);
- }
- refactoring.setRootView(rootView);
-
- List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
- checkEdits(basename, changes);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java
deleted file mode 100644
index 582ed0f27..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import static com.android.SdkConstants.FQCN_RADIO_BUTTON;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.w3c.dom.Element;
-
-import java.util.List;
-
-public class ChangeViewRefactoringTest extends RefactoringTest {
-
- public void testChangeView1() throws Exception {
- checkRefactoring("sample1a.xml", FQCN_RADIO_BUTTON, "@+id/button1", "@+id/button6");
- }
-
- public void testChangeView2() throws Exception {
- // Tests (1) updating references to the renamed id of the changed widgets
- // (e.g. button3 is renamed to imageButton1 and layout references to button3
- // must be updated), and (2) removal of attributes not available in the new type
- // (the text property is removed since it is not available on the new widget
- // type ImageButton)
- checkRefactoring("sample2.xml", "android.widget.ImageButton",
- "@+id/button3", "@+id/button5");
- }
-
- private void checkRefactoring(String basename, String newType,
- String... ids) throws Exception {
- assertTrue(ids.length > 0);
-
- IFile file = getLayoutFile(getProject(), basename);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- List<Element> selectedElements = getElements(info.mElement, ids);
-
- ChangeViewRefactoring refactoring = new ChangeViewRefactoring(selectedElements,
- layoutEditor);
- refactoring.setType(newType);
-
- List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
- checkEdits(basename, changes);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java
deleted file mode 100644
index 1667649c5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import static com.android.SdkConstants.DOT_XML;
-
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.w3c.dom.Element;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ExtractIncludeRefactoringTest extends RefactoringTest {
-
- @Override
- protected boolean autoFormat() {
- return false;
- }
-
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- // Because some of these tests look at ALL layouts in the project
- // to identify matches
- return true;
- }
-
- public void testExtract1() throws Exception {
- // Basic: Extract a single button
- checkRefactoring("sample3.xml", "newlayout1", false, null, 2, false /* diffs */,
- "@+id/button2");
- }
-
- public void testExtract2() throws Exception {
- // Extract a couple of elements
- checkRefactoring("sample3.xml", "newlayout2", false, null, 2, false /* diffs */,
- "@+id/button2", "@+id/android_logo");
- }
-
- public void testExtract3() throws Exception {
- // Test to make sure layout attributes are updated
- checkRefactoring("sample2.xml", "newlayout3", false, null, 2, false /* diffs */,
- "@+id/button3");
- }
-
- public void testExtract4() throws Exception {
- // Tests extracting from -multiple- files (as well as with custom android namespace
- // prefix)
-
- // Make sure the variation-files exist
- Map<IPath, String> extraFiles = new HashMap<IPath, String>();
- extraFiles.put(getTestDataFile(getProject(), "sample3-variation1.xml",
- "res/layout-land/sample3.xml").getProjectRelativePath(),
- "sample3-variation1.xml");
- extraFiles.put(getTestDataFile(getProject(), "sample3-variation2.xml",
- "res/layout-xlarge-land/sample3.xml").getProjectRelativePath(),
- "sample3-variation2.xml");
-
- checkRefactoring("sample3.xml", "newlayout3", true, extraFiles, 4, false /* diffs */,
- "@+id/android_logo");
- }
-
- public void testExtract5() throws Exception {
- // Tests extracting from multiple files with -contiguous regions-.
-
- // Make sure the variation-files exist
- Map<IPath, String> extraFiles = new HashMap<IPath, String>();
- extraFiles.put(getTestDataFile(getProject(), "sample3-variation1.xml",
- "res/layout-land/sample3.xml").getProjectRelativePath(),
- "sample3-variation1.xml");
- extraFiles.put(getTestDataFile(getProject(), "sample3-variation2.xml",
- "res/layout-xlarge-land/sample3.xml").getProjectRelativePath(),
- "sample3-variation2.xml");
-
- checkRefactoring("sample3.xml", "newlayout3", true, extraFiles, 4, false /* diffs */,
- "@+id/android_logo", "@+id/button1");
- }
-
- public void testExtract6() throws Exception {
- // Tests extracting from multiple files where the layouts are completely
- // different/unrelated files
-
- // Create the duplicate files
- Map<IPath, String> extraFiles = new HashMap<IPath, String>();
- extraFiles.put(getTestDataFile(getProject(), "sample1a.xml",
- "res/layout/sample1a.xml").getProjectRelativePath(),
- "sample1a.xml");
- extraFiles.put(getTestDataFile(getProject(), "sample7.xml", "res/layout/sample7.xml")
- .getProjectRelativePath(), "sample7.xml");
- extraFiles.put(getTestDataFile(getProject(), "sample8.xml", "res/layout/sample8.xml")
- .getProjectRelativePath(), "sample8.xml");
-
- checkRefactoring("sample7.xml", "newlayout6", true, extraFiles, 4, true /* diffs */,
- "@+id/linearLayout4");
- }
-
- public void testExtract7() throws Exception {
- // Just like testExtract6, except we turn on auto-formatting
- IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
- AdtPrefs.init(store);
- AdtPrefs prefs = AdtPrefs.getPrefs();
- prefs.initializeStoreWithDefaults(store);
- store.setValue(AdtPrefs.PREFS_FORMAT_GUI_XML, true);
- prefs.loadValues(null);
-
- assertTrue(AdtPrefs.getPrefs().getFormatGuiXml());
-
- testExtract6();
- }
-
-
- private void checkRefactoring(String basename, String layoutName,
- boolean replaceOccurrences, Map<IPath,String> extraFiles,
- int expectedModifiedFileCount, boolean createDiffs, String... ids) throws Exception {
- assertTrue(ids.length > 0);
-
- IFile file = getLayoutFile(getProject(), basename);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- List<Element> selectedElements = getElements(info.mElement, ids);
-
- ExtractIncludeRefactoring refactoring = new ExtractIncludeRefactoring(selectedElements,
- layoutEditor);
- refactoring.setLayoutName(layoutName);
- refactoring.setReplaceOccurrences(replaceOccurrences);
- List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
-
- assertTrue(changes.size() >= 3);
-
- Map<IPath,String> fileToGolden = new HashMap<IPath,String>();
- IPath sourcePath = file.getProjectRelativePath();
- fileToGolden.put(sourcePath, basename);
- IPath newPath = sourcePath.removeLastSegments(1).append(layoutName + DOT_XML);
- fileToGolden.put(newPath, layoutName + DOT_XML);
- if (extraFiles != null) {
- fileToGolden.putAll(extraFiles);
- }
-
- checkEdits(changes, fileToGolden, createDiffs);
-
- int modifiedFileCount = 0;
- for (Change change : changes) {
- if (change instanceof TextFileChange) {
- modifiedFileCount++;
- }
- }
- assertEquals(expectedModifiedFileCount, modifiedFileCount);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java
deleted file mode 100644
index f64555dd6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import com.android.utils.Pair;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.TextFileChange;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class ExtractStyleRefactoringTest extends RefactoringTest {
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- return true;
- }
-
- public void testExtract1() throws Exception {
- // Test extracting into a new style file
- checkRefactoring("extractstyle1.xml", "newstyles.xml", "newstyle",
- false /* removeExtracted */, false /* applyStyle */, null, 1, "@+id/button2");
- }
-
- public void testExtract1b() throws Exception {
- // Extract and apply new style
- checkRefactoring("extractstyle1.xml", "newstyles2.xml", "newstyle",
- false /* removeExtracted */, true /* applyStyle */, null, 2, "@+id/button2");
- }
-
- public void testExtract1c() throws Exception {
- // Extract and remove extracted
- checkRefactoring("extractstyle1.xml", "newstyles3.xml", "newstyle",
- true /* removeExtracted */, false /* applyStyle */, null, 2, "@+id/button2");
- }
-
- public void testExtract1d() throws Exception {
- // Extract and apply style and remove extracted
- checkRefactoring("extractstyle1.xml", "newstyles4.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 2, "@+id/button2");
- }
-
- public void testExtract2() throws Exception {
- getTestDataFile(getProject(), "navigationstyles.xml", "res/values/navigationstyles.xml");
-
- // -Modify- the existing styles.xml file
- checkRefactoring("extractstyle1.xml", "navigationstyles.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 2, "@+id/button2");
- }
-
- public void testExtract3() throws Exception {
- // Select multiple elements - overlap in values.
- checkRefactoring("extractstyle1.xml", "newstyles4.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 2,
- "@+id/button1", "@+id/button2");
- }
-
- // This test fails for some reason - not in the refactoring (checked manually)
- // but the DOM model returns null when run in a test context.
- public void testExtract4() throws Exception {
- // Test extracting on a single caret position over an attribute: Should extract
- // just that one attribute
- checkRefactoringByOffset("extractstyle1.xml", "newstyles5.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 2,
- "android:text^Color=\"#FF00FF\"", "android:text^Color=\"#FF00FF\"");
- }
-
- public void testExtract5() throws Exception {
- // Test extracting on a range selection inside an element: should extract just
- // the attributes that overlap the selection
- checkRefactoringByOffset("extractstyle1.xml", "newstyles6.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 2,
- "android:^textSize=\"20pt",
- "android:id=\"@+id/button1\" android:layout_a^lignParentBottom");
- }
-
- public void testExtract6() throws Exception {
- // Test extracting on a single caret position which is not over any attributes:
- checkRefactoringByOffset("extractstyle1.xml", "newstyles7.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 0,
- "<Bu^tton", "<Bu^tton");
- }
-
- public void testExtract7() throws Exception {
- // Verify that even with a different namespace prefix we end up with android:
- // in the extracted style
- checkRefactoring("extractstyle2.xml", "newstyles8.xml", "newstyle",
- true /* removeExtracted */, true /* applyStyle */, null, 2,
- "@+id/button1", "@+id/button2");
- }
-
- public void testExtract8() throws Exception {
- // Test setting parent style
- checkRefactoring("extractstyle1.xml", "newstyles3.xml", "newstyle",
- true /* removeExtracted */, false /* applyStyle */, "android:Widget.Button",
- 2, "@+id/button2");
- }
-
- // Check extract style on a selection of elements
- private void checkRefactoring(String basename, String styleFileName, String newStyleName,
- boolean removeExtracted, boolean applyStyle, String parentStyle,
- int expectedModifiedFileCount, String... ids) throws Exception {
- assertTrue(ids.length > 0);
-
- IFile file = getLayoutFile(getProject(), basename);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- List<Element> selectedElements = getElements(info.mElement, ids);
-
- // Open the file such that ModelManager.getExistingModelForRead() in DomUtilities
- // will succeed
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = activeWorkbenchWindow.getActivePage();
- IDE.openEditor(page, file);
-
- ExtractStyleRefactoring refactoring = new ExtractStyleRefactoring(selectedElements,
- layoutEditor);
- checkRefactoring(basename, styleFileName, newStyleName, removeExtracted, applyStyle,
- parentStyle, expectedModifiedFileCount, file, refactoring);
- }
-
- // Check extract style against a set of editor text locations
- private void checkRefactoringByOffset(String basename, String styleFileName,
- String newStyleName, boolean removeExtracted, boolean applyStyle,
- String parentStyle,
- int expectedModifiedFileCount, String beginCaretLocation, String endCaretLocation)
- throws Exception {
- IFile file = getLayoutFile(getProject(), basename);
- int beginOffset = getCaretOffset(file, beginCaretLocation);
- int endOffset = getCaretOffset(file, endCaretLocation);
-
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
-
- // Open the file such that ModelManager.getExistingModelForRead() in DomUtilities
- // will succeed
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = activeWorkbenchWindow.getActivePage();
- IDE.openEditor(page, file);
-
- ITextSelection selection = new TextSelection(beginOffset, endOffset - beginOffset);
- ExtractStyleRefactoring refactoring = new ExtractStyleRefactoring(file,
- layoutEditor, selection, null);
- checkRefactoring(basename, styleFileName, newStyleName, removeExtracted, applyStyle,
- parentStyle, expectedModifiedFileCount, file, refactoring);
- }
-
- // Common test code used by the other two check methods
- private void checkRefactoring(String basename, String styleFileName, String newStyleName,
- boolean removeExtracted, boolean applyStyle, String parentStyle,
- int expectedModifiedFileCount, IFile file,
- ExtractStyleRefactoring refactoring) throws Exception {
- refactoring.setStyleName(newStyleName);
- refactoring.setApplyStyle(applyStyle);
- refactoring.setRemoveExtracted(removeExtracted);
- refactoring.setStyleFileName(styleFileName);
- refactoring.setParent(parentStyle);
-
- // Pick the attributes to extract -- for now everything (and where there are
- // conflicting values, pick the first one)
- Pair<Map<String, List<Attr>>, Set<Attr>> result = refactoring.getAvailableAttributes();
- Map<String, List<Attr>> availableAttributes = result.getFirst();
- Set<Attr> selected = result.getSecond();
- List<Attr> chosenAttributes = new ArrayList<Attr>();
- for (List<Attr> list : availableAttributes.values()) {
- Collections.sort(list, new Comparator<Attr>() {
- @Override
- public int compare(Attr a1, Attr a2) {
- return a1.getValue().compareTo(a2.getValue());
- }
- });
- Attr attr = list.get(0);
- if (selected.contains(attr)) {
- chosenAttributes.add(attr);
- }
- }
- refactoring.setChosenAttributes(chosenAttributes);
-
- List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
- assertEquals(expectedModifiedFileCount, changes.size());
-
- Map<IPath,String> fileToGolden = new HashMap<IPath,String>();
- IPath sourcePath = file.getProjectRelativePath();
- fileToGolden.put(sourcePath, basename);
- IPath newPath = refactoring.getStyleFile(getProject()).getProjectRelativePath();
- fileToGolden.put(newPath, styleFileName);
-
- checkEdits(changes, fileToGolden, true);
-
- int modifiedFileCount = 0;
- for (Change change : changes) {
- if (change instanceof TextFileChange) {
- modifiedFileCount++;
- }
- }
- assertEquals(expectedModifiedFileCount, modifiedFileCount);
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
deleted file mode 100644
index b22717991..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import static com.android.SdkConstants.FD_RES;
-import static com.android.SdkConstants.FD_RES_LAYOUT;
-
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-public class RefactoringAssistantTest extends AdtProjectTest {
- public void testAssistant1() throws Exception {
- // "Extract String"
- checkFixes("sample1a.xml", "<Button android:text=\"Fir^stButton\"");
- }
-
- public void testAssistant2() throws Exception {
- // Visual refactoring operations
- checkFixes("sample1a.xml", "<Bu^tton android:text");
- }
-
- public void testAssistant3() throws Exception {
- checkFixes("sample1a.xml", "<Button andr^oid:text=\"FirstButton\"");
- }
-
- public void testAssistant4() throws Exception {
- // Check for resource rename refactoring (and don't offer extract string)
- checkFixes("sample1a.xml", "android:id=\"@+id/Linea^rLayout2\"");
- }
-
- private void checkFixes(String name, String caretLocation)
- throws Exception {
- IProject project = getProject();
- IFile file = getTestDataFile(project, name, FD_RES + "/" + FD_RES_LAYOUT + "/" + name);
-
- // Determine the offset
- String fileContent = AdtPlugin.readFile(file);
- int caretDelta = caretLocation.indexOf("^");
- assertTrue(caretLocation, caretDelta != -1);
- String caretContext = caretLocation.substring(0, caretDelta)
- + caretLocation.substring(caretDelta + "^".length());
- int caretContextIndex = fileContent.indexOf(caretContext);
- assertTrue("Caret content " + caretContext + " not found in file",
- caretContextIndex != -1);
- final int offset = caretContextIndex + caretDelta;
-
-
- RefactoringAssistant refactoringAssistant = new RefactoringAssistant();
-
- // Open file
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- assertNotNull(page);
- IEditorPart editor = IDE.openEditor(page, file);
- assertTrue(editor instanceof AndroidXmlEditor);
- AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
- final ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
-
- IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() {
- @Override
- public int getLength() {
- return 0;
- }
-
- @Override
- public int getOffset() {
- return offset;
- }
-
- @Override
- public ISourceViewer getSourceViewer() {
- return viewer;
- }
- };
- ICompletionProposal[] proposals = refactoringAssistant
- .computeQuickAssistProposals(invocationContext);
-
- if (proposals != null) {
- for (ICompletionProposal proposal : proposals) {
- assertNotNull(proposal.getAdditionalProposalInfo());
- assertNotNull(proposal.getImage());
- }
- }
-
- StringBuilder sb = new StringBuilder(1000);
- sb.append("Quick assistant in " + name + " for " + caretLocation + ":\n");
- if (proposals != null) {
- for (ICompletionProposal proposal : proposals) {
- sb.append(proposal.getDisplayString());
- String help = proposal.getAdditionalProposalInfo();
- if (help != null && help.trim().length() > 0) {
- sb.append(" : ");
- sb.append(help.replace('\n', ' '));
- }
- sb.append('\n');
- }
- } else {
- sb.append("None found.\n");
- }
- assertEqualsGolden(name, sb.toString(), "txt");
-
- // No "apply" test on these assists since they are interactive. Refactoring
- // is tested elsewhere.
- }
-}
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
deleted file mode 100644
index 9565183bc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import static com.android.SdkConstants.ANDROID_WIDGET_PREFIX;
-import static com.android.SdkConstants.DOT_XML;
-
-import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.eclipse.adt.AdtPlugin;
-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.uimodel.UiViewElementNode;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-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.TextFileChange;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-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.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-@SuppressWarnings("restriction")
-public class RefactoringTest extends AdtProjectTest {
-
- protected boolean autoFormat() {
- return true;
- }
-
- @Override
- protected void setUp() throws Exception {
-
- // Ensure that the defaults are initialized so for example formatting options are
- // initialized properly
- IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
- AdtPrefs.init(store);
- AdtPrefs prefs = AdtPrefs.getPrefs();
- prefs.initializeStoreWithDefaults(store);
-
- store.setValue(AdtPrefs.PREFS_FORMAT_GUI_XML, autoFormat());
-
- prefs.loadValues(null);
-
- super.setUp();
- }
-
- protected static Element findElementById(Element root, String id) {
- if (id.equals(VisualRefactoring.getId(root))) {
- return root;
- }
-
- for (Element child : DomUtilities.getChildren(root)) {
- Element result = findElementById(child, id);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-
- protected static List<Element> getElements(Element root, String... ids) {
- List<Element> selectedElements = new ArrayList<Element>();
- for (String id : ids) {
- Element element = findElementById(root, id);
- assertNotNull(element);
- selectedElements.add(element);
- }
- return selectedElements;
- }
-
- protected void checkEdits(String basename, List<Change> changes) throws BadLocationException,
- IOException {
- IDocument document = new Document();
-
- String xml = readTestFile(basename, false);
- if (xml == null) { // New file
- xml = ""; //$NON-NLS-1$
- }
- document.set(xml);
-
- for (Change change : changes) {
- 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);
- } else {
- edit.apply(document);
- }
- } else {
- System.out.println("Ignoring non-textfilechange in refactoring result");
- }
- }
-
- String actual = document.get();
-
- // Ensure that the document is still valid to make sure the edits don't
- // mangle it:
- org.w3c.dom.Document doc = DomUtilities.parseDocument(actual, true);
- assertNotNull(actual, doc);
-
- assertEqualsGolden(basename, actual);
- }
-
- protected void checkEdits(List<Change> changes,
- 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, IOException {
- for (Change change : changes) {
- if (change instanceof TextFileChange) {
- TextFileChange tf = (TextFileChange) change;
- IFile file = tf.getFile();
- assertNotNull(file);
- IPath path = file.getProjectRelativePath();
- String goldenName = fileToGoldenName.get(path);
- assertNotNull("Not found: " + path.toString(), goldenName);
-
- String xml = readTestFile(goldenName, false);
- if (xml == null) { // New file
- xml = ""; //$NON-NLS-1$
- }
- IDocument document = new Document();
- document.set(xml);
-
- String before = document.get();
-
- TextEdit edit = tf.getEdit();
- if (edit instanceof MultiTextEdit) {
- MultiTextEdit edits = (MultiTextEdit) edit;
- edits.apply(document);
- } else {
- edit.apply(document);
- }
-
- String actual = document.get();
-
- if (createDiffs) {
- // Use a diff as the golden file instead of the after
- actual = getDiff(before, actual);
- if (goldenName.endsWith(DOT_XML)) {
- goldenName = goldenName.substring(0,
- goldenName.length() - DOT_XML.length())
- + ".diff";
- }
- }
-
- assertEqualsGolden(goldenName, actual);
- } else {
- System.out.println("Ignoring non-textfilechange in refactoring result");
- assertNull(change.getAffectedObjects());
- }
- }
- }
-
- protected UiViewElementNode createModel(UiViewElementNode parent, Element element) {
- List<Element> children = DomUtilities.getChildren(element);
- String fqcn = ANDROID_WIDGET_PREFIX + element.getTagName();
- boolean hasChildren = children.size() > 0;
- UiViewElementNode node = createNode(parent, fqcn, hasChildren);
- node.setXmlNode(element);
- for (Element child : children) {
- createModel(node, child);
- }
-
- return node;
- }
-
- /**
- * Builds up a ViewInfo hierarchy for the given model. This is done by
- * reading .info dump files which record the exact pixel sizes of each
- * ViewInfo object. These files are assumed to match up exactly with the
- * model objects. This is done rather than rendering an actual layout
- * hierarchy to insulate the test from pixel difference (in say font size)
- * among platforms, as well as tying the test to particulars about relative
- * sizes of things which may change with theme adjustments etc.
- * <p>
- * Each file can be generated by the dump method in the ViewHierarchy.
- */
- 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);
- // Parse the info file and build up a model from it
- // Each line contains a new info.
- // If indented it is a child of the parent.
- String[] lines = info.split("\n"); //$NON-NLS-1$
-
- // Iteration order for the info file should match exactly the UI model so
- // we can just advance the line index sequentially as we traverse
-
- return create(model, Arrays.asList(lines).iterator());
- }
-
- protected ViewInfo create(UiElementNode node, Iterator<String> lineIterator) {
- // android.widget.LinearLayout [0,36,240,320]
- Pattern pattern = Pattern.compile("(\\s*)(\\S+) \\[(\\d+),(\\d+),(\\d+),(\\d+)\\].*");
- assertTrue(lineIterator.hasNext());
- String description = lineIterator.next();
- Matcher matcher = pattern.matcher(description);
- assertTrue(matcher.matches());
- //String indent = matcher.group(1);
- //String fqcn = matcher.group(2);
- String left = matcher.group(3);
- String top = matcher.group(4);
- String right = matcher.group(5);
- String bottom = matcher.group(6);
-
- ViewInfo view = new ViewInfo(node.getXmlNode().getLocalName(), node,
- Integer.parseInt(left), Integer.parseInt(top),
- Integer.parseInt(right), Integer.parseInt(bottom));
-
- List<UiElementNode> childNodes = node.getUiChildren();
- if (childNodes.size() > 0) {
- List<ViewInfo> children = new ArrayList<ViewInfo>();
- for (UiElementNode child : childNodes) {
- children.add(create(child, lineIterator));
- }
- view.setChildren(children);
- }
-
- return view;
- }
-
- protected TestContext setupTestContext(IFile file, String relativePath) throws Exception {
- IStructuredModel structuredModel = null;
- org.w3c.dom.Document domDocument = null;
- IStructuredDocument structuredDocument = null;
- Element element = null;
-
- try {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- structuredModel = modelManager.getModelForRead(file);
- if (structuredModel instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) structuredModel;
- domDocument = domModel.getDocument();
- element = domDocument.getDocumentElement();
- structuredDocument = structuredModel.getStructuredDocument();
- }
- } finally {
- if (structuredModel != null) {
- structuredModel.releaseFromRead();
- }
- }
-
- assertNotNull(structuredModel);
- assertNotNull(domDocument);
- assertNotNull(element);
- assertNotNull(structuredDocument);
- assertTrue(element instanceof IndexedRegion);
-
- UiViewElementNode model = createModel(null, element);
- ViewInfo info = createInfos(model, relativePath);
- CanvasViewInfo rootView = CanvasViewInfo.create(info, true /* layoutlib5 */).getFirst();
- TestLayoutEditorDelegate layoutEditor =
- new TestLayoutEditorDelegate(file, structuredDocument, null);
-
- TestContext testInfo = createTestContext();
- testInfo.mFile = file;
- testInfo.mStructuredModel = structuredModel;
- testInfo.mStructuredDocument = structuredDocument;
- testInfo.mElement = element;
- testInfo.mDomDocument = domDocument;
- testInfo.mUiModel = model;
- testInfo.mViewInfo = info;
- testInfo.mRootView = rootView;
- testInfo.mLayoutEditorDelegate = layoutEditor;
-
- return testInfo;
- }
-
- protected TestContext createTestContext() {
- return new TestContext();
- }
-
- protected static class TestContext {
- protected IFile mFile;
- protected IStructuredModel mStructuredModel;
- protected IStructuredDocument mStructuredDocument;
- protected org.w3c.dom.Document mDomDocument;
- protected Element mElement;
- protected UiViewElementNode mUiModel;
- protected ViewInfo mViewInfo;
- protected CanvasViewInfo mRootView;
- protected TestLayoutEditorDelegate mLayoutEditorDelegate;
- }
-
- @Override
- public void testDummy() {
- // To avoid JUnit warning that this class contains no tests, even though
- // this is an abstract class and JUnit shouldn't try
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java
deleted file mode 100644
index e03ea9e06..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-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.RefactoringStatus;
-import org.w3c.dom.Element;
-
-import java.util.List;
-
-public class UnwrapRefactoringTest extends RefactoringTest {
-
- public void testUnwrap1() throws Exception {
- // Unwrap view with parent, no children - this will unwrap the parent (frame layout)
- checkRefactoring("unwrap.xml", "@+id/button");
- }
-
- public void testUnwrap2() throws Exception {
- // Unwrap view with parent and children; this should unwrap the element itself
- checkRefactoring("unwrap.xml", "@+id/frame");
- }
-
- public void testUnwrap3() throws Exception {
- // Unwrap root: should transfer namespace
- checkRefactoring("unwrap.xml", "@+id/linear");
- }
-
- private void checkRefactoring(String basename, String id) throws Exception {
- IFile file = getLayoutFile(getProject(), basename);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- List<Element> selectedElements = getElements(info.mElement, id);
- assertEquals(1, selectedElements.size());
-
- UnwrapRefactoring refactoring = new UnwrapRefactoring(selectedElements,
- layoutEditor);
-
- RefactoringStatus status = refactoring.checkInitialConditions(new NullProgressMonitor());
- assertFalse(status.hasError());
- List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
- checkEdits(basename, changes);
- }
-}
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
deleted file mode 100644
index 01a0e1e7d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2011 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.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;
-
-@SuppressWarnings("javadoc")
-public class UseCompoundDrawableRefactoringTest extends RefactoringTest {
- public void testCombine() throws Exception {
- assertNull(combine(null, null));
- assertNull(combine("@dimen/foo", "@dimen/bar"));
- assertNull(combine("@dimen/foo", "@dimen/bar"));
- assertNull(combine("1sp", "@dimen/bar"));
- assertNull(combine("1sp", "2dp"));
- assertNull(combine(null, ""));
- assertNull(combine("", null));
-
- assertEquals("@dimen/foo", combine(null, "@dimen/foo"));
- assertEquals("@dimen/foo", combine("@dimen/foo", null));
- assertEquals("5sp", combine("5sp", null));
-
- assertEquals("10sp", combine("8sp", "2sp"));
- assertEquals("50dp", combine("30dp", "20dp"));
- }
-
- public void test1() throws Exception {
- // Test converting an image above a text view
- checkRefactoring("refactoring/usecompound/compound1.xml", "@+id/layout1");
- }
-
- public void test2() throws Exception {
- // Test converting an image below a text view
- checkRefactoring("refactoring/usecompound/compound2.xml", "@+id/layout2");
- }
-
- public void test3() throws Exception {
- // Test converting an image to the left of a text view
- checkRefactoring("refactoring/usecompound/compound3.xml", "@+id/layout3");
- }
-
- public void test4() throws Exception {
- // Test converting an image to the right of a text view
- checkRefactoring("refactoring/usecompound/compound4.xml", "@+id/layout4");
- }
-
- public void test5() throws Exception {
- // Test converting an image where the LinearLayout is referenced (in a relative layout)
- // and the text view has an id
- checkRefactoring("refactoring/usecompound/compound_all.xml", "@+id/layout2");
- }
-
- public void test6() throws Exception {
- // Test converting an image where the LinearLayout is referenced (in a relative layout)
- // and the text view does not have an id
- checkRefactoring("refactoring/usecompound/compound_all.xml", "@+id/layout3");
- }
-
- public void test7() throws Exception {
- // Test converting where a namespace needs to be migrated
- checkRefactoring("refactoring/usecompound/compound5.xml", "@+id/layout");
- }
-
- public void test8() throws Exception {
- // Test padding handling
- checkRefactoring("refactoring/usecompound/compound6.xml", "@+id/layout1");
- }
-
- public void test9() throws Exception {
- // Test margin combination
- checkRefactoring("refactoring/usecompound/compound7.xml", "@+id/layout1");
- }
-
- private void checkRefactoring(String basename, String id)
- throws Exception {
- IFile file = getLayoutFile(getProject(), basename);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- List<Element> selectedElements = getElements(info.mElement, new String[] { id });
-
- 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/WrapInRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java
deleted file mode 100644
index 2dc6744e6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.refactoring;
-
-import static com.android.SdkConstants.FQCN_GESTURE_OVERLAY_VIEW;
-import static com.android.SdkConstants.FQCN_LINEAR_LAYOUT;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.w3c.dom.Element;
-
-import java.util.List;
-
-public class WrapInRefactoringTest extends RefactoringTest {
-
- public void testWrapIn1() throws Exception {
- // Test wrapping view: should indent view
- checkRefactoring("sample3.xml", FQCN_LINEAR_LAYOUT, "@+id/button2");
- }
-
- public void testWrapIn2() throws Exception {
- // Test wrapping the root: should move namespace
- checkRefactoring("sample3.xml", FQCN_GESTURE_OVERLAY_VIEW, "@+id/newlinear");
- }
-
- public void testWrapIn3() throws Exception {
- // Test wrap multiple adjacent elements - should wrap all as a unit
- checkRefactoring("sample3.xml", FQCN_LINEAR_LAYOUT, "@+id/button2", "@+id/android_logo");
- }
-
- private void checkRefactoring(String basename, String fqcn, String... ids) throws Exception {
- assertTrue(ids.length > 0);
-
- IFile file = getLayoutFile(getProject(), basename);
- TestContext info = setupTestContext(file, basename);
- TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
- List<Element> selectedElements = getElements(info.mElement, ids);
-
- WrapInRefactoring refactoring = new WrapInRefactoring(selectedElements,
- layoutEditor);
- refactoring.setType(fqcn);
- List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
- checkEdits(basename, changes);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt
deleted file mode 100644
index 0942a19fe..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.android.eclipse.tests;
-
-import android.app.Fragment;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-public class TestFragment extends Fragment {
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return null;
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml
deleted file mode 100644
index d72f4ba4c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="50pt"
- android:layout_marginLeft="50dp"
- android:layout_marginBottom="50"
- />
-</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml
deleted file mode 100644
index b720daac8..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
- <style name="repeatedStyle1">
- <item name="android:gravity">left</item>
- </style>
- <style name="repeatedStyle1">
- <item name="android:gravity">bottom</item>
- </style>
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml
deleted file mode 100644
index bc9c134c7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
- <style name="wrongAttribute">
- <item name="nonexistent">5</item>
- </style>
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml
deleted file mode 100644
index 28dd46786..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <style>
- <item />
- </style>
- <item></item>
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml
deleted file mode 100644
index ee89ac4be..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <style name="test">
- <item name="android:layout_width"></item>
- </style>
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml
deleted file mode 100644
index e552ff797..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop=""
- android:layout_marginLeft=''
- />
-</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml
deleted file mode 100644
index d47f4ae83..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
- <TextView
- android:id=""
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- />
-</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt
deleted file mode 100644
index 3e44918d9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Code completion in anim1.xml for ^<set xmlns:
-<alpha />
-<rotate />
-<scale />
-<set ></set>
-<translate />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt
deleted file mode 100644
index f5e5cba69..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Code completion in anim1.xml for ^<translate android:id=:
-<alpha />
-<rotate />
-<scale />
-<set ></set>
-<translate />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt
deleted file mode 100644
index 385f4761b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Code completion in anim1.xml for android:^fromXDelta=:
-android:fromXDelta : [float, fraction]
-android:toXDelta : [float, fraction]
-android:fromYDelta : [float, fraction]
-android:toYDelta : [float, fraction]
-android:interpolator : Defines the interpolator used to smooth the animation movement in time. [reference]
-android:fillEnabled : When set to true, the value of fillBefore is taken into account. [boolean]
-android:fillBefore : When set to true or when fillEnabled is not set to true, the animation transformation is applied before the animation has started. [boolean]
-android:fillAfter : When set to true, the animation transformation is applied after the animation is over. [boolean]
-android:duration : Amount of time (in milliseconds) for the animation to run. [integer]
-android:startOffset : Delay in milliseconds before the animation runs, once start time is reached. [integer]
-android:repeatCount : Defines how many times the animation should repeat. [integer, enum]
-android:repeatMode : Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. [enum]
-android:zAdjustment : Allows for an adjustment of the Z ordering of the content being animated for the duration of the animation. [enum]
-android:background : Special background behind animation. [color, reference]
-android:detachWallpaper : Special option for window animations: if this window is on top of a wallpaper, don't animate the wallpaper with it. [boolean]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt
deleted file mode 100644
index e12a66fa5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Code completion in anim1.xml for android:^fromAlpha=:
-android:fromAlpha : [float]
-android:toAlpha : [float]
-android:interpolator : Defines the interpolator used to smooth the animation movement in time. [reference]
-android:fillEnabled : When set to true, the value of fillBefore is taken into account. [boolean]
-android:fillBefore : When set to true or when fillEnabled is not set to true, the animation transformation is applied before the animation has started. [boolean]
-android:fillAfter : When set to true, the animation transformation is applied after the animation is over. [boolean]
-android:duration : Amount of time (in milliseconds) for the animation to run. [integer]
-android:startOffset : Delay in milliseconds before the animation runs, once start time is reached. [integer]
-android:repeatCount : Defines how many times the animation should repeat. [integer, enum]
-android:repeatMode : Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. [enum]
-android:zAdjustment : Allows for an adjustment of the Z ordering of the content being animated for the duration of the animation. [enum]
-android:background : Special background behind animation. [color, reference]
-android:detachWallpaper : Special option for window animations: if this window is on top of a wallpaper, don't animate the wallpaper with it. [boolean]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt
deleted file mode 100644
index 9225dac46..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in anim1.xml for android:fromXDelta="100^%p":
-100% : <b>Fraction</b> - a percentage of the base size
-100%p : <b>Fraction</b> - a percentage relative to parent container
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml
deleted file mode 100644
index 48fefc2ba..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<set xmlns:android="http://schemas.android.com/apk/res/android">
- <translate android:id="@+id/test1"
- android:fromXDelta="100%p"
- android:pivotY="60%p"
- android:toXDelta="40%p"
- android:toYDelta="33%p"
- android:fillBefore="true"
- android:fillAfter="true"
- android:startOffset="1000"
- android:duration="1000" />
- <alpha
- android:id="@+id/test2"
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:startOffset="3000"
- android:duration="250"
- android:fillBefore="true"
- android:fillAfter="false"
- />
-</set>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt
deleted file mode 100644
index 075941502..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in animator1.xml for ^<set xmlns:
-<animator ></animator>
-<objectAnimator ></objectAnimator>
-<set ></set>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt
deleted file mode 100644
index 474fe7761..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Code completion in animator1.xml for android:^duration="2000":
-android:propertyName : Name of the property being animated. [string]
-android:interpolator : Defines the interpolator used to smooth the animation movement in time. [reference]
-android:duration : Amount of time (in milliseconds) for the animation to run. [integer]
-android:startOffset : Delay in milliseconds before the animation runs, once start time is reached. [integer]
-android:repeatCount : Defines how many times the animation should repeat. [integer, enum]
-android:repeatMode : Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. [enum]
-android:valueFrom : Value the animation starts from. [integer, float, color, dimension]
-android:valueTo : Value the animation animates to. [integer, float, color, dimension]
-android:valueType : The type of valueFrom and valueTo. [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt
deleted file mode 100644
index 3e5e6b127..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in animator1.xml for android:propertyName="scal^eX"/>:
-scaleX : scale of the view in the x direction.
-scaleY : scale of the view in the y direction.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt
deleted file mode 100644
index b298ac0b4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Code completion in animator1.xml for android:interpolator="^@android:anim/bounce_interpolator":
-@android:anim/accelerate_decelerate_interpolator
-@android:anim/accelerate_interpolator
-@android:anim/decelerate_interpolator
-@android:anim/anticipate_interpolator
-@android:anim/overshoot_interpolator
-@android:anim/anticipate_overshoot_interpolator
-@android:anim/bounce_interpolator
-@android:anim/linear_interpolator
-@android:anim/cycle_interpolator
-@android:
-@+id/
-@anim/
-@color/
-@drawable/
-@id/
-@layout/
-@string/
-@style/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml
deleted file mode 100644
index bdf10dced..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!-- Simple bounce animation -->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:ordering="sequentially">
- <set>
- <objectAnimator
- android:duration="2000"
- android:valueTo="310"
- android:propertyName="x"/>
- <objectAnimator
- android:duration="2000"
- android:valueTo="130"
- android:propertyName="y"
- android:interpolator="@android:anim/bounce_interpolator"/>
- <objectAnimator
- android:duration="2000"
- android:valueTo=".4"
- android:propertyName="scaleX"/>
- <objectAnimator
- android:duration="2000"
- android:valueTo=".4"
- android:propertyName="scaleY"/>
- </set>
- <objectAnimator
- android:duration="500"
- android:valueTo="0"
- android:propertyName="alpha"/>
-</set>
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
deleted file mode 100644
index 4ce3540da..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in broken1.xml for android:textColorHigh^ selecting 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/broken1-expected-completion20.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt
deleted file mode 100644
index 063dc8c4b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in broken1.xml for android:textColorHigh^:
-android:textColorHighlight : Color of the text selection highlight. [color, reference]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml
deleted file mode 100644
index 161b9818c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:text="@string/app_name"
- android:textColorHigh
- android:layout_marginLeft="@android:dimen/app_icon_size"
- android:id="@+id/button1"
- ></Button>
-</LinearLayout>
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
deleted file mode 100644
index 3337ad265..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in broken2.xml for style=^ selecting "@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/broken2-expected-completion21.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt
deleted file mode 100644
index 1ee2585cd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in broken2.xml for style=^:
-"@android:"
-"@+id/"
-"@drawable/"
-"@id/"
-"@layout/"
-"@string/"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml
deleted file mode 100644
index 60644b90c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:text="@string/app_name"
- android:layout_marginLeft="@android:dimen/app_icon_size"
- style=
- android:id="@+id/button1"
- ></Button>
-</LinearLayout>
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
deleted file mode 100644
index 2787380ee..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in broken3.xml for <EditT^ selecting 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/broken3-expected-completion19.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt
deleted file mode 100644
index ccc6a4c66..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in broken3.xml for <EditT^:
-EditText />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml
deleted file mode 100644
index b8b168586..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <EditT
- <Button
- android:text="@string/app_name"
- android:layout_marginLeft="@android:dimen/app_icon_size"
- android:id="@+id/button1"
- ></Button>
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt
deleted file mode 100644
index c799b8094..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in color1.xml for ^<selector:
-<selector ></selector> : Required. This must be the root element. Contains one or more <item> elements.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt
deleted file mode 100644
index 32f0066b6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in color1.xml for ^<item android:
-<item /> : Drawable states.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
deleted file mode 100644
index def6d13b1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Code completion in color1.xml for <item ^android:state_focused="true"/>:
-android:state_focused : State value for StateListDrawable, set when a view has input focus. [boolean]
-android:state_window_focused : State value for StateListDrawable, set when a view's window has input focus. [boolean]
-android:state_enabled : State value for StateListDrawable, set when a view is enabled. [boolean]
-android:state_checkable : State identifier indicating that the object <var>may</var> display a check mark. [boolean]
-android:state_checked : State identifier indicating that the object is currently checked. [boolean]
-android:state_selected : State value for StateListDrawable, set when a view (or one of its parents) is currently selected. [boolean]
-android:state_pressed : State value for StateListDrawable, set when the user is pressing down in a view. [boolean]
-android:state_activated : State value for StateListDrawable, set when a view or its parent has been "activated" meaning the user has currently marked it as being of interest. [boolean]
-android:state_active : State value for StateListDrawable. [boolean]
-android:state_single : State value for StateListDrawable. [boolean]
-android:state_first : State value for StateListDrawable. [boolean]
-android:state_middle : State value for StateListDrawable. [boolean]
-android:state_last : State value for StateListDrawable. [boolean]
-android:state_accelerated : State value for StateListDrawable, indicating that the Drawable is in a view that is hardware accelerated. [boolean]
-android:state_hovered : State value for StateListDrawable, set when a pointer is hovering over the view. [boolean]
-android:state_drag_can_accept : State for StateListDrawable indicating that the Drawable is in a view that is capable of accepting a drop of the content currently being manipulated in a drag-and-drop operation. [boolean]
-android:state_drag_hovered : State for StateListDrawable indicating that a drag operation (for which the Drawable's view is a valid recipient) is currently positioned over the Drawable. [boolean]
-android:state_accessibility_focused : State for StateListDrawable indicating that a View has accessibility focus. [boolean]
-android:color : Hexadeximal color. Required. The color is specified with an RGB value and optional alpha channel. The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats: * RGB * ARGB * RRGGBB * AARRGGBB
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml
deleted file mode 100644
index a8482abac..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector
- xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_focused="true"/>
- <item />
-</selector>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml
deleted file mode 100644
index 2413658a7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
-<!--
- This file deliberately contains errors - it represents partial keyboard
- typing for interactive code completion
--->
- <TextView
- android:layout_weight^="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@android:dimen/app_icon_size"
- android:layout_marginLeft="50dp"
- android:layout_marginBottom="50"
- android:textColor="#000000"
- style="@android:style/Widget.Button"
- android:gravity="left|bottom"
- android:text="@string/hello"
- android:hint="hint" />
- <FrameLayout android:foreground="@android:drawable/btn_default"></FrameLayout>
-</LinearLayout>
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
deleted file mode 100644
index 6b0556615..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_w^idth="fill_parent" selecting android:layout_weight:
-@@ -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
deleted file mode 100644
index 7b448c29f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for <T^extView selecting 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
deleted file mode 100644
index 1a5f24d6c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for ^<TextView selecting <RadioGroup ></RadioGroup>:
-@@ -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
deleted file mode 100644
index 9010bf60c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for ^<TextView selecting <CheckBox />:
-@@ -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
deleted file mode 100644
index a7a463877..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for btn_default">^</FrameLayout> selecting <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
deleted file mode 100644
index 77761316d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_width="^fill_parent" selecting 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
deleted file mode 100644
index e67a3369d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_width="fi^ll_parent" selecting 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
deleted file mode 100644
index fe63acd22..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for marginBottom="50"^ selecting 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
deleted file mode 100644
index 2d229f3c4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for marginBottom="50^" selecting 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
deleted file mode 100644
index 5a2b413d1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_marginLeft="50d^p" selecting 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
deleted file mode 100644
index d3a8c1120..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for style="@android:^style/Widget.Button" selecting @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
deleted file mode 100644
index afd7e21e0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for android:gravity="l^eft|bottom" selecting 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
deleted file mode 100644
index 73f2bd48a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for android:gravity="left|b^ottom" selecting 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-applyCompletion8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff
deleted file mode 100644
index 655afc529..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion1.xml for layout_width^="fill_parent" selecting android:layout_width:
-No changes \ 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/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
deleted file mode 100644
index 1b4198e43..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_width=^"fill_parent" selecting "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/completion1-expected-completion1.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt
deleted file mode 100644
index c3e75ad54..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completion1.xml for layout_w^idth="fill_parent":
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
-android:layout_weight : [float]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt
deleted file mode 100644
index 973d95eff..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Code completion in completion1.xml for <T^extView:
-TabHost
-TabWidget
-TableLayout
-TableRow
-TextSwitcher
-TextView
-TextureView
-TimePicker
-ToggleButton
-TwoLineListItem
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
deleted file mode 100644
index 20dad3a53..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-Code completion in completion1.xml for ^<TextView:
-<AbsoluteLayout ></AbsoluteLayout>
-<AdapterViewFlipper ></AdapterViewFlipper>
-<AnalogClock />
-<AutoCompleteTextView />
-<Button />
-<CalendarView />
-<CheckBox />
-<CheckedTextView />
-<Chronometer />
-<DatePicker />
-<DialerFilter ></DialerFilter>
-<DigitalClock />
-<EditText />
-<ExpandableListView ></ExpandableListView>
-<FrameLayout ></FrameLayout>
-<Gallery />
-<GridLayout ></GridLayout>
-<GridView ></GridView>
-<HorizontalScrollView ></HorizontalScrollView>
-<ImageButton />
-<ImageSwitcher ></ImageSwitcher>
-<ImageView />
-<LinearLayout ></LinearLayout>
-<ListView ></ListView>
-<MediaController ></MediaController>
-<MultiAutoCompleteTextView />
-<NumberPicker />
-<ProgressBar />
-<QuickContactBadge />
-<RadioButton />
-<RadioGroup ></RadioGroup>
-<RatingBar />
-<RelativeLayout ></RelativeLayout>
-<ScrollView ></ScrollView>
-<SearchView ></SearchView>
-<SeekBar />
-<SlidingDrawer ></SlidingDrawer> : SlidingDrawer specific attributes.
-<Space />
-<Spinner />
-<StackView ></StackView>
-<SurfaceView />
-<Switch />
-<TabHost ></TabHost>
-<TabWidget ></TabWidget>
-<TableLayout ></TableLayout>
-<TableRow ></TableRow>
-<TextSwitcher ></TextSwitcher>
-<TextView />
-<TextureView />
-<TimePicker />
-<ToggleButton />
-<TwoLineListItem />
-<VideoView />
-<View /> : Attributes that can be used with android.view.View or any of its subclasses.
-<ViewAnimator ></ViewAnimator>
-<ViewFlipper ></ViewFlipper>
-<ViewStub /> : A android.view.ViewStub lets you lazily include other XML layouts inside your application at runtime.
-<ViewSwitcher ></ViewSwitcher>
-<WebView />
-<ZoomButton />
-<ZoomControls />
-<android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
-<fragment /> : A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity
-<include /> : Lets you statically include XML layouts inside other XML layouts.
-<requestFocus /> : Requests focus for the parent element or one of its descendants
-<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
deleted file mode 100644
index 8da18db43..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-Code completion in completion1.xml for btn_default">^</FrameLayout>:
-<AbsoluteLayout ></AbsoluteLayout>
-<AdapterViewFlipper ></AdapterViewFlipper>
-<AnalogClock />
-<AutoCompleteTextView />
-<Button />
-<CalendarView />
-<CheckBox />
-<CheckedTextView />
-<Chronometer />
-<DatePicker />
-<DialerFilter ></DialerFilter>
-<DigitalClock />
-<EditText />
-<ExpandableListView ></ExpandableListView>
-<FrameLayout ></FrameLayout>
-<Gallery />
-<GridLayout ></GridLayout>
-<GridView ></GridView>
-<HorizontalScrollView ></HorizontalScrollView>
-<ImageButton />
-<ImageSwitcher ></ImageSwitcher>
-<ImageView />
-<LinearLayout ></LinearLayout>
-<ListView ></ListView>
-<MediaController ></MediaController>
-<MultiAutoCompleteTextView />
-<NumberPicker />
-<ProgressBar />
-<QuickContactBadge />
-<RadioButton />
-<RadioGroup ></RadioGroup>
-<RatingBar />
-<RelativeLayout ></RelativeLayout>
-<ScrollView ></ScrollView>
-<SearchView ></SearchView>
-<SeekBar />
-<SlidingDrawer ></SlidingDrawer> : SlidingDrawer specific attributes.
-<Space />
-<Spinner />
-<StackView ></StackView>
-<SurfaceView />
-<Switch />
-<TabHost ></TabHost>
-<TabWidget ></TabWidget>
-<TableLayout ></TableLayout>
-<TableRow ></TableRow>
-<TextSwitcher ></TextSwitcher>
-<TextView />
-<TextureView />
-<TimePicker />
-<ToggleButton />
-<TwoLineListItem />
-<VideoView />
-<View /> : Attributes that can be used with android.view.View or any of its subclasses.
-<ViewAnimator ></ViewAnimator>
-<ViewFlipper ></ViewFlipper>
-<ViewStub /> : A android.view.ViewStub lets you lazily include other XML layouts inside your application at runtime.
-<ViewSwitcher ></ViewSwitcher>
-<WebView />
-<ZoomButton />
-<ZoomControls />
-<android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
-<fragment /> : A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity
-<include /> : Lets you statically include XML layouts inside other XML layouts.
-<requestFocus /> : Requests focus for the parent element or one of its descendants
-<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt
deleted file mode 100644
index 136a6fe4d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_width="^fill_parent":
-fill_parent
-match_parent
-wrap_content
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt
deleted file mode 100644
index 09c27ce2d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion1.xml for layout_width="fi^ll_parent":
-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-completion39.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
deleted file mode 100644
index 2ac2d3186..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-Code completion in completion1.xml for marginBottom="50"^:
-style : A reference to a custom style [reference]
-android:bufferType : Determines the minimum type that getText() will return. [enum]
-android:text : Text to display. [string]
-android:hint : Hint text to display when the text is empty. [string]
-android:textColor : Text color. [color, reference]
-android:textColorHighlight : Color of the text selection highlight. [color, reference]
-android:textColorHint : Color of the hint text. [color, reference]
-android:textAppearance : Base text color, typeface, size, and style. [reference]
-android:textSize : Size of the text. [dimension]
-android:textScaleX : Sets the horizontal scaling factor for the text. [float]
-android:typeface : Typeface (normal, sans, serif, monospace) for the text. [enum]
-android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
-android:fontFamily : Font family (named by string) for the text. [string]
-android:textColorLink : Text color for links. [color, reference]
-android:cursorVisible : Makes the cursor visible (the default) or invisible. [boolean]
-android:maxLines : Makes the TextView be at most this many lines tall. [integer]
-android:maxHeight : Makes the TextView be at most this many pixels tall. [dimension]
-android:lines : Makes the TextView be exactly this many lines tall. [integer]
-android:height : Makes the TextView be exactly this many pixels tall. [dimension]
-android:minLines : Makes the TextView be at least this many lines tall. [integer]
-android:minHeight : Makes the TextView be at least this many pixels tall. [dimension]
-android:maxEms : Makes the TextView be at most this many ems wide. [integer]
-android:maxWidth : Makes the TextView be at most this many pixels wide. [dimension]
-android:ems : Makes the TextView be exactly this many ems wide. [integer]
-android:width : Makes the TextView be exactly this many pixels wide. [dimension]
-android:minEms : Makes the TextView be at least this many ems wide. [integer]
-android:minWidth : Makes the TextView be at least this many pixels wide. [dimension]
-android:gravity : Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view. [flag]
-android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). [boolean]
-android:password : Whether the characters of the field are displayed as password dots instead of themselves. * Deprecated: Use inputType instead. [boolean]
-android:singleLine : Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layo...
-android:enabled : Specifies whether the widget is enabled. [boolean]
-android:selectAllOnFocus : If the text is selectable, select it all when the view takes focus. [boolean]
-android:includeFontPadding : Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolean]
-android:maxLength : Set an input filter to constrain the text length to the specified number. [integer]
-android:shadowColor : Place a shadow of the specified color behind the text. [color]
-android:shadowDx : Horizontal offset of the shadow. [float]
-android:shadowDy : Vertical offset of the shadow. [float]
-android:shadowRadius : Radius of the shadow. [float]
-android:autoLink : Controls whether links such as urls and email addresses are automatically found and converted to clickable links. [flag]
-android:linksClickable : If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. [boolean]
-android:numeric : If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead. [flag]
-android:digits : If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. [string]
-android:phoneNumber : If set, specifies that this TextView has a phone number input method. * Deprecated: Use inputType instead. [boolean]
-android:inputMethod : If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). * Deprecated: Use inputType instead. [string]
-android:capitalize : If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. * Deprecated: Use inputType instead. [enum]
-android:autoText : If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. * Deprecated: Use inputType instead. [boolean]
-android:editable : If set, specifies that this TextView has an input method. * Deprecated: Use inputType instead. [boolean]
-android:freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. [boolean]
-android:ellipsize : If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. [enum]
-android:drawableTop : The drawable to be drawn above the text. [color, reference]
-android:drawableBottom : The drawable to be drawn below the text. [color, reference]
-android:drawableLeft : The drawable to be drawn to the left of the text. [color, reference]
-android:drawableRight : The drawable to be drawn to the right of the text. [color, reference]
-android:drawableStart : The drawable to be drawn to the start of the text. [color, reference]
-android:drawableEnd : The drawable to be drawn to the end of the text. [color, reference]
-android:drawablePadding : The padding between the drawables and the text. [dimension]
-android:lineSpacingExtra : Extra spacing between lines of text. [dimension]
-android:lineSpacingMultiplier : Extra spacing between lines of text, as a multiplier. [float]
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
-android:inputType : The type of data being placed in a text field, used to help an input method decide how to let the user enter text. [flag]
-android:imeOptions : Additional features you can enable in an IME associated with an editor to improve the integration with your application. [flag]
-android:privateImeOptions : An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method. [string]
-android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view. [string]
-android:imeActionId : Supply a value for EditorInfo.actionId used when an input method is connected to the text view. [integer]
-android:editorExtras : Reference to an "input-extras" XML resource containing additional data to supply to an input method, which is private to the implementation of the input method. [reference]
-android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
-android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
-android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
-android:textEditPasteWindowLayout : The layout of the view that is displayed on top of the cursor to paste inside a TextEdit field. [reference]
-android:textEditNoPasteWindowLayout : Variation of textEditPasteWindowLayout displayed when the clipboard is empty. [reference]
-android:textEditSidePasteWindowLayout : Used instead of textEditPasteWindowLayout when the window is moved on the side of the insertion cursor because it would be clipped if it were positioned on top. [reference]
-android:textEditSideNoPasteWindowLayout : Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. [reference]
-android:textEditSuggestionItemLayout : Layout of the TextView item that will populate the suggestion popup window. [reference]
-android:textCursorDrawable : Reference to a drawable that will be drawn under the insertion cursor. [reference]
-android:textIsSelectable : Indicates that the content of a non-editable text can be selected. [boolean]
-android:textAllCaps : Present the text in ALL CAPS. [boolean]
-android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
-android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
-android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
-android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
-android:background : A drawable to use as the background. [color, reference]
-android:padding : Sets the padding, in pixels, of all four edges. [dimension]
-android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
-android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
-android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
-android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
-android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
-android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
-android:focusable : Boolean that controls whether a view can take focus. [boolean]
-android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
-android:visibility : Controls the initial visibility of the view. [enum]
-android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
-android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
-android:scrollbarStyle : Controls the scrollbar style and position. [enum]
-android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
-android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
-android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
-android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
-android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
-android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
-android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
-android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
-android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
-android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
-android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
-android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
-android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
-android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
-android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
-android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:clickable : Defines whether this view reacts to click events. [boolean]
-android:longClickable : Defines whether this view reacts to long click events. [boolean]
-android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
-android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
-android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
-android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
-android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
-android:minHeight : Defines the minimum height of the view.
-android:minWidth : Defines the minimum width of the view.
-android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
-android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
-android:contentDescription : Defines text that briefly describes content of the view. [string]
-android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
-android:overScrollMode : Defines over-scrolling behavior. [enum]
-android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
-android:translationX : translation in x of the view. [dimension]
-android:translationY : translation in y of the view. [dimension]
-android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
-android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
-android:rotation : rotation of the view, in degrees. [float]
-android:rotationX : rotation of the view around the x axis, in degrees. [float]
-android:rotationY : rotation of the view around the y axis, in degrees. [float]
-android:scaleX : scale of the view in the x direction. [float]
-android:scaleY : scale of the view in the y direction. [float]
-android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
-android:layerType : Specifies the type of layer backing this view. [enum]
-android:layoutDirection : Defines the direction of layout drawing. [enum]
-android:textDirection : Direction of the text. [integer, enum]
-android:textAlignment : Alignment of the text. [integer, enum]
-android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
-android:layout_height : Specifies the basic height of the view. [dimension, enum]
-android:layout_weight : [float]
-android:layout_gravity : Standard gravity constant that a child can supply to its parent. [flag]
-android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
-android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
-android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
-android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
-android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
-android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
-android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt
deleted file mode 100644
index a9111eb31..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in completion1.xml for marginBottom="50^":
-50dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
-50sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
-50pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
-50mm : <b>Millimeters</b> - based on the physical size of the screen.
-50in : <b>Inches</b> - based on the physical size of the screen.
-50px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt
deleted file mode 100644
index 6b1c99363..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion1.xml for layout_marginLeft="50d^p":
-50dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt
deleted file mode 100644
index 99f92b8f3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Code completion in completion1.xml for style="@android:^style/Widget.Button":
-@android:style/
-@android:anim/
-@android:animator/
-@android:array/
-@android:attr/
-@android:bool/
-@android:color/
-@android:declare-styleable/
-@android:dimen/
-@android:drawable/
-@android:fraction/
-@android:id/
-@android:integer/
-@android:interpolator/
-@android:layout/
-@android:menu/
-@android:mipmap/
-@android:plurals/
-@android:public/
-@android:raw/
-@android:string/
-@android:xml/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt
deleted file mode 100644
index cf373adde..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion1.xml for android:gravity="l^eft|bottom":
-left
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt
deleted file mode 100644
index 66276d628..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion1.xml for android:gravity="left|b^ottom":
-bottom
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt
deleted file mode 100644
index a364bc3ff..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion1.xml for layout_width^="fill_parent":
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt
deleted file mode 100644
index ab6a0d249..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion1.xml for layout_width=^"fill_parent":
-"fill_parent"
-"match_parent"
-"wrap_content"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml
deleted file mode 100644
index d523eeb3d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
-<!--
- This file deliberately contains errors - it represents partial keyboard
- typing for interactive code completion
--->
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@android:dimen/app_icon_size"
- android:layout_marginLeft="50dp"
- android:layout_marginBottom="50"
- android:textColor="#000000"
- style="@android:style/Widget.Button"
- android:gravity="left|bottom"
- android:text="@string/hello"
- android:hint="hint" />
- <FrameLayout android:foreground="@android:drawable/btn_default"></FrameLayout>
-</LinearLayout>
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
deleted file mode 100644
index af28a1343..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion10.xml for "[^wrap_content]" selecting 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
deleted file mode 100644
index 0a4d338e2..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion10.xml for "[^wrap_c]ontent" selecting 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-completion65.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt
deleted file mode 100644
index 69fae0da3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion10.xml for "[^wrap_content]":
-fill_parent
-match_parent
-wrap_content
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml
deleted file mode 100644
index 57b38ee11..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center_vertical">
-<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/gallery"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"/>
-</RelativeLayout>
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
deleted file mode 100644
index 321deaa46..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion11.xml for ?android:attr/Textapp^ selecting ?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/completion11-expected-complation79.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt
deleted file mode 100644
index 3748c77ec..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Code completion in completion11.xml for tools:context="^.MainActivity":
-android.accounts.AccountAuthenticatorActivity : <p>See <code><a href="/reference/android/app/SearchManager.html">android.app.SearchManager</a></code> for more details.</td> </tr> <tr class=" api apilevel-1" > <td class="jd-typecol">int</td> <td class="jd-linkcol"...
-android.app.ActivityGroup : <p> <p class="caution"> <strong>This class was deprecated in API level 13</strong>.<br/> Use the new <code><a href="/reference/android/app/Fragment.html">Fragment</a></code> and <code><a href="/reference/android/app/FragmentManager.html">FragmentManager</...
-android.app.AliasActivity : <p>See <code><a href="/reference/android/app/SearchManager.html">android.app.SearchManager</a></code> for more details.</td> </tr> <tr class=" api apilevel-1" > <td class="jd-typecol">int</td> <td class="jd-linkcol"><a href="/reference...
-android.app.ExpandableListActivity : <p> ExpandableListActivity hosts a <code><a href="/reference/android/widget/ExpandableListView.html">ExpandableListView</a></code> object that can be bound to different data sources that provide a two-levels of data (the top-level is group, and below each ...
-android.app.LauncherActivity : <div id="jd-header"> public abstract class <h1 itemprop="name">LauncherActivity</h1> extends <a href="/reference/android/app/ListActivity.html">ListActivity</a><br/> ...
-android.app.ListActivity : <p> ListActivity hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can be bound to different data sources, typically either an array or a Cursor holding query results. Binding, screen layout, and row layout are discussed ...
-android.app.NativeActivity : <p>A typical manifest would look like: <pre>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.native_activity" android:versionCode="1" android:versionName="1.0"&gt; &lt;!-- This is the platform ...
-android.app.TabActivity : <p> <p class="caution"> <strong>This class was deprecated in API level 13</strong>.<br/> New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the F...
-android.preference.PreferenceActivity : <p>This activity shows one or more headers of preferences, each of which is associated with a <code><a href="/reference/android/preference/PreferenceFragment.html">PreferenceFragment</a></code> to display the preferences of that header. The actual layout...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt
deleted file mode 100644
index e4c21f9a4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completion11.xml for ?^android:attr/Textapp:
-?android:attr/
-?attr/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt
deleted file mode 100644
index 04cbbce93..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Code completion in completion11.xml for ?android:attr/Textapp^:
-?android:attr/textAppearance : Base text color, typeface, size, and style.
-?android:attr/textAppearanceButton
-?android:attr/textAppearanceInverse
-?android:attr/textAppearanceLarge
-?android:attr/textAppearanceLargeInverse
-?android:attr/textAppearanceLargePopupMenu
-?android:attr/textAppearanceListItem
-?android:attr/textAppearanceListItemSmall
-?android:attr/textAppearanceMedium
-?android:attr/textAppearanceMediumInverse
-?android:attr/textAppearanceSearchResultSubtitle
-?android:attr/textAppearanceSearchResultTitle
-?android:attr/textAppearanceSmall
-?android:attr/textAppearanceSmallInverse
-?android:attr/textAppearanceSmallPopupMenu
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt
deleted file mode 100644
index 9579c93db..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion11.xml for ?and^roid:attr/Textapp:
-?android:attr/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml
deleted file mode 100644
index e15b83019..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <TextView
- style="?android:attr/Textapp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:text="@string/hello_world"
- tools:context=".MainActivity" />
-
-</RelativeLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt
deleted file mode 100644
index 5ad38e61c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-Code completion in completion12.xml for <include ^/>:
-layout : [reference]. * Required.
-style : A reference to a custom style [reference]
-android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
-android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
-android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
-android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
-android:background : A drawable to use as the background. [color, reference]
-android:padding : Sets the padding, in pixels, of all four edges. [dimension]
-android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
-android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
-android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
-android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
-android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
-android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
-android:focusable : Boolean that controls whether a view can take focus. [boolean]
-android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
-android:visibility : Controls the initial visibility of the view. [enum]
-android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
-android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
-android:scrollbarStyle : Controls the scrollbar style and position. [enum]
-android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
-android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
-android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
-android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
-android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
-android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
-android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
-android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
-android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
-android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
-android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
-android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
-android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
-android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
-android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
-android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:clickable : Defines whether this view reacts to click events. [boolean]
-android:longClickable : Defines whether this view reacts to long click events. [boolean]
-android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
-android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
-android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
-android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
-android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
-android:minHeight : Defines the minimum height of the view.
-android:minWidth : Defines the minimum width of the view.
-android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
-android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
-android:contentDescription : Defines text that briefly describes content of the view. [string]
-android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
-android:overScrollMode : Defines over-scrolling behavior. [enum]
-android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
-android:translationX : translation in x of the view. [dimension]
-android:translationY : translation in y of the view. [dimension]
-android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
-android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
-android:rotation : rotation of the view, in degrees. [float]
-android:rotationX : rotation of the view around the x axis, in degrees. [float]
-android:rotationY : rotation of the view around the y axis, in degrees. [float]
-android:scaleX : scale of the view in the x direction. [float]
-android:scaleY : scale of the view in the y direction. [float]
-android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
-android:layerType : Specifies the type of layer backing this view. [enum]
-android:layoutDirection : Defines the direction of layout drawing. [enum]
-android:textDirection : Direction of the text. [integer, enum]
-android:textAlignment : Alignment of the text. [integer, enum]
-android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
-android:layout_toLeftOf : Positions the right edge of this view to the left of the given anchor view ID. [reference]
-android:layout_toRightOf : Positions the left edge of this view to the right of the given anchor view ID. [reference]
-android:layout_above : Positions the bottom edge of this view above the given anchor view ID. [reference]
-android:layout_below : Positions the top edge of this view below the given anchor view ID. [reference]
-android:layout_alignBaseline : Positions the baseline of this view on the baseline of the given anchor view ID. [reference]
-android:layout_alignLeft : Makes the left edge of this view match the left edge of the given anchor view ID. [reference]
-android:layout_alignTop : Makes the top edge of this view match the top edge of the given anchor view ID. [reference]
-android:layout_alignRight : Makes the right edge of this view match the right edge of the given anchor view ID. [reference]
-android:layout_alignBottom : Makes the bottom edge of this view match the bottom edge of the given anchor view ID. [reference]
-android:layout_alignParentLeft : If true, makes the left edge of this view match the left edge of the parent. [boolean]
-android:layout_alignParentTop : If true, makes the top edge of this view match the top edge of the parent. [boolean]
-android:layout_alignParentRight : If true, makes the right edge of this view match the right edge of the parent. [boolean]
-android:layout_alignParentBottom : If true, makes the bottom edge of this view match the bottom edge of the parent. [boolean]
-android:layout_centerInParent : If true, centers this child horizontally and vertically within its parent. [boolean]
-android:layout_centerHorizontal : If true, centers this child horizontally within its parent. [boolean]
-android:layout_centerVertical : If true, centers this child vertically within its parent. [boolean]
-android:layout_alignWithParentIfMissing : If set to true, the parent will be used as the anchor when the anchor cannot be be found for layout_toLeftOf, layout_toRightOf, etc. [boolean]
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
-android:layout_height : Specifies the basic height of the view. [dimension, enum]
-android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
-android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
-android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
-android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
-android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
-android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
-android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml
deleted file mode 100644
index 946a23277..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <include />
-
-</RelativeLayout>
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
deleted file mode 100644
index b36573657..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion2.xml for gravity="left|bottom|^cen selecting fill_vertical:
-@@ -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
deleted file mode 100644
index 46268af6d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion2.xml for gravity="left|bottom|cen^ selecting center_horizontal:
-@@ -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
deleted file mode 100644
index bcac56d16..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion2.xml for gravity="left|bottom^|cen selecting bottom|fill_horizontal:
-@@ -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/completion2-expected-completion13a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt
deleted file mode 100644
index dd28c7365..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Code completion in completion2.xml for gravity="left|bottom|^cen:
-top
-bottom
-left
-right
-center_vertical
-fill_vertical
-center_horizontal
-fill_horizontal
-center
-fill
-clip_vertical
-clip_horizontal
-start
-end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt
deleted file mode 100644
index 8e6d4d865..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion2.xml for gravity="left|bottom|cen^:
-center_vertical
-center_horizontal
-center
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt
deleted file mode 100644
index 0aebfedea..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Code completion in completion2.xml for gravity="left|bottom^|cen:
-bottom
-bottom|top
-bottom|right
-bottom|center_vertical
-bottom|fill_vertical
-bottom|center_horizontal
-bottom|fill_horizontal
-bottom|center
-bottom|fill
-bottom|clip_vertical
-bottom|clip_horizontal
-bottom|start
-bottom|end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml
deleted file mode 100644
index 0921674cd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- Test multiple pipes in the flag value -->
- <TextView android:gravity="left|bottom|cen"></TextView>
-</LinearLayout>
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
deleted file mode 100644
index ef070b28e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion3.xml for <EditText ^/> selecting 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
deleted file mode 100644
index 283636b4e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion3.xml for <Button ^></Button> selecting android:paddingRight:
-@@ -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/completion3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml
deleted file mode 100644
index afb64b827..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
- <EditText />
- <Button ></Button>
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt
deleted file mode 100644
index c7170dfcc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion4.xml for <Button^:
-Button
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml
deleted file mode 100644
index 0047772f5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:text="@string/app_name"
- android:layout_marginLeft="@android:dimen/app_icon_size"
- android:id="@+id/button1"
- ></Button>
-</LinearLayout>
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
deleted file mode 100644
index 3f7866324..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion5.xml for android:orientation='^' selecting 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
deleted file mode 100644
index 4933d1320..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion5.xml for android:layout_marginTop='50^dp' selecting 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
deleted file mode 100644
index a4c88d7fc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion5.xml for android:layout_width='^wrap_content' selecting 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
deleted file mode 100644
index 705f865ce..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion5.xml for android:id='@+id/button2'^ selecting 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/completion5-expected-completion40.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
deleted file mode 100644
index a4cf0fa45..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-Code completion in completion5.xml for android:id='@+id/button2'^:
-style : A reference to a custom style [reference]
-android:bufferType : Determines the minimum type that getText() will return. [enum]
-android:text : Text to display. [string]
-android:hint : Hint text to display when the text is empty. [string]
-android:textColor : Text color. [color, reference]
-android:textColorHighlight : Color of the text selection highlight. [color, reference]
-android:textColorHint : Color of the hint text. [color, reference]
-android:textAppearance : Base text color, typeface, size, and style. [reference]
-android:textSize : Size of the text. [dimension]
-android:textScaleX : Sets the horizontal scaling factor for the text. [float]
-android:typeface : Typeface (normal, sans, serif, monospace) for the text. [enum]
-android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
-android:fontFamily : Font family (named by string) for the text. [string]
-android:textColorLink : Text color for links. [color, reference]
-android:cursorVisible : Makes the cursor visible (the default) or invisible. [boolean]
-android:maxLines : Makes the TextView be at most this many lines tall. [integer]
-android:maxHeight : Makes the TextView be at most this many pixels tall. [dimension]
-android:lines : Makes the TextView be exactly this many lines tall. [integer]
-android:height : Makes the TextView be exactly this many pixels tall. [dimension]
-android:minLines : Makes the TextView be at least this many lines tall. [integer]
-android:minHeight : Makes the TextView be at least this many pixels tall. [dimension]
-android:maxEms : Makes the TextView be at most this many ems wide. [integer]
-android:maxWidth : Makes the TextView be at most this many pixels wide. [dimension]
-android:ems : Makes the TextView be exactly this many ems wide. [integer]
-android:width : Makes the TextView be exactly this many pixels wide. [dimension]
-android:minEms : Makes the TextView be at least this many ems wide. [integer]
-android:minWidth : Makes the TextView be at least this many pixels wide. [dimension]
-android:gravity : Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view. [flag]
-android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). [boolean]
-android:password : Whether the characters of the field are displayed as password dots instead of themselves. * Deprecated: Use inputType instead. [boolean]
-android:singleLine : Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layo...
-android:enabled : Specifies whether the widget is enabled. [boolean]
-android:selectAllOnFocus : If the text is selectable, select it all when the view takes focus. [boolean]
-android:includeFontPadding : Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolean]
-android:maxLength : Set an input filter to constrain the text length to the specified number. [integer]
-android:shadowColor : Place a shadow of the specified color behind the text. [color]
-android:shadowDx : Horizontal offset of the shadow. [float]
-android:shadowDy : Vertical offset of the shadow. [float]
-android:shadowRadius : Radius of the shadow. [float]
-android:autoLink : Controls whether links such as urls and email addresses are automatically found and converted to clickable links. [flag]
-android:linksClickable : If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. [boolean]
-android:numeric : If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead. [flag]
-android:digits : If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. [string]
-android:phoneNumber : If set, specifies that this TextView has a phone number input method. * Deprecated: Use inputType instead. [boolean]
-android:inputMethod : If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). * Deprecated: Use inputType instead. [string]
-android:capitalize : If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. * Deprecated: Use inputType instead. [enum]
-android:autoText : If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. * Deprecated: Use inputType instead. [boolean]
-android:editable : If set, specifies that this TextView has an input method. * Deprecated: Use inputType instead. [boolean]
-android:freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. [boolean]
-android:ellipsize : If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. [enum]
-android:drawableTop : The drawable to be drawn above the text. [color, reference]
-android:drawableBottom : The drawable to be drawn below the text. [color, reference]
-android:drawableLeft : The drawable to be drawn to the left of the text. [color, reference]
-android:drawableRight : The drawable to be drawn to the right of the text. [color, reference]
-android:drawableStart : The drawable to be drawn to the start of the text. [color, reference]
-android:drawableEnd : The drawable to be drawn to the end of the text. [color, reference]
-android:drawablePadding : The padding between the drawables and the text. [dimension]
-android:lineSpacingExtra : Extra spacing between lines of text. [dimension]
-android:lineSpacingMultiplier : Extra spacing between lines of text, as a multiplier. [float]
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
-android:inputType : The type of data being placed in a text field, used to help an input method decide how to let the user enter text. [flag]
-android:imeOptions : Additional features you can enable in an IME associated with an editor to improve the integration with your application. [flag]
-android:privateImeOptions : An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method. [string]
-android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view. [string]
-android:imeActionId : Supply a value for EditorInfo.actionId used when an input method is connected to the text view. [integer]
-android:editorExtras : Reference to an "input-extras" XML resource containing additional data to supply to an input method, which is private to the implementation of the input method. [reference]
-android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
-android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
-android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
-android:textEditPasteWindowLayout : The layout of the view that is displayed on top of the cursor to paste inside a TextEdit field. [reference]
-android:textEditNoPasteWindowLayout : Variation of textEditPasteWindowLayout displayed when the clipboard is empty. [reference]
-android:textEditSidePasteWindowLayout : Used instead of textEditPasteWindowLayout when the window is moved on the side of the insertion cursor because it would be clipped if it were positioned on top. [reference]
-android:textEditSideNoPasteWindowLayout : Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. [reference]
-android:textEditSuggestionItemLayout : Layout of the TextView item that will populate the suggestion popup window. [reference]
-android:textCursorDrawable : Reference to a drawable that will be drawn under the insertion cursor. [reference]
-android:textIsSelectable : Indicates that the content of a non-editable text can be selected. [boolean]
-android:textAllCaps : Present the text in ALL CAPS. [boolean]
-android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
-android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
-android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
-android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
-android:background : A drawable to use as the background. [color, reference]
-android:padding : Sets the padding, in pixels, of all four edges. [dimension]
-android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
-android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
-android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
-android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
-android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
-android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
-android:focusable : Boolean that controls whether a view can take focus. [boolean]
-android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
-android:visibility : Controls the initial visibility of the view. [enum]
-android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
-android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
-android:scrollbarStyle : Controls the scrollbar style and position. [enum]
-android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
-android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
-android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
-android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
-android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
-android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
-android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
-android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
-android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
-android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
-android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
-android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
-android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
-android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
-android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
-android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:clickable : Defines whether this view reacts to click events. [boolean]
-android:longClickable : Defines whether this view reacts to long click events. [boolean]
-android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
-android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
-android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
-android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
-android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
-android:minHeight : Defines the minimum height of the view.
-android:minWidth : Defines the minimum width of the view.
-android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
-android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
-android:contentDescription : Defines text that briefly describes content of the view. [string]
-android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
-android:overScrollMode : Defines over-scrolling behavior. [enum]
-android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
-android:translationX : translation in x of the view. [dimension]
-android:translationY : translation in y of the view. [dimension]
-android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
-android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
-android:rotation : rotation of the view, in degrees. [float]
-android:rotationX : rotation of the view around the x axis, in degrees. [float]
-android:rotationY : rotation of the view around the y axis, in degrees. [float]
-android:scaleX : scale of the view in the x direction. [float]
-android:scaleY : scale of the view in the y direction. [float]
-android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
-android:layerType : Specifies the type of layer backing this view. [enum]
-android:layoutDirection : Defines the direction of layout drawing. [enum]
-android:textDirection : Direction of the text. [integer, enum]
-android:textAlignment : Alignment of the text. [integer, enum]
-android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
-android:layout_height : Specifies the basic height of the view. [dimension, enum]
-android:layout_weight : [float]
-android:layout_gravity : Standard gravity constant that a child can supply to its parent. [flag]
-android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
-android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
-android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
-android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
-android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
-android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
-android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml
deleted file mode 100644
index 757be8b8e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<LinearLayout
- xmlns:android='http://schemas.android.com/apk/res/android'
- android:layout_width='match_parent'
- android:orientation=''
- android:layout_height='match_parent'>
- <Button
- android:text="what's up doc?"
- android:id='@+id/button1'
- android:layout_marginTop='50dp'
- android:layout_width='wrap_content'
- android:layout_height='wrap_content'></Button>
- <Button
- android:text="quote='"
- android:id='@+id/button2'
- android:layout_width='wrap_content'
- android:layout_height='wrap_content'></Button>
- <Button
- android:text='quote="'
- android:id='@+id/button2'
- android:layout_width='wrap_content'
- android:layout_height='wrap_content'></Button>
-</LinearLayout>
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
deleted file mode 100644
index 92cd2f2ab..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion6.xml for android:orientation="^" selecting 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/completion6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml
deleted file mode 100644
index 55bfa0c93..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<LinearLayout
- xmlns:android='http://schemas.android.com/apk/res/android'
- android:layout_width='match_parent'
- android:orientation=""
- android:layout_height='match_parent'>
-</LinearLayout>
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
deleted file mode 100644
index 1aaadc267..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion7.xml for android:orientation="^ selecting 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.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml
deleted file mode 100644
index 30afbaf4f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<LinearLayout
- xmlns:android='http://schemas.android.com/apk/res/android'
- android:layout_width='match_parent'
- android:orientation="
- android:layout_height='match_parent'>
-</LinearLayout>
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
deleted file mode 100644
index 7678740d1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion8.xml for android:mar^="50dp" selecting android:layout_marginRight:
-@@ -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/completion8-expected-completion41.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
deleted file mode 100644
index 0c2e215ec..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Code completion in completion8.xml for android:mar^="50dp":
-android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
-android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
-android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
-android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
-android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
-android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
-android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
deleted file mode 100644
index f5b072093..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completion8.xml for android:w^i="100":
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
-android:layout_weight : [float]
-android:width : Makes the TextView be exactly this many pixels wide. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
deleted file mode 100644
index 50f13d18b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Code completion in completion8.xml for mar^="60dp":
-android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
-android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
-android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
-android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
-android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
-android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
-android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
deleted file mode 100644
index 357814507..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Code completion in completion8.xml for android:layo^ut_width="fill_parent":
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
-android:layout_height : Specifies the basic height of the view. [dimension, enum]
-android:layout_weight : [float]
-android:layout_gravity : Standard gravity constant that a child can supply to its parent. [flag]
-android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
-android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
-android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
-android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
-android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
-android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
-android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
-android:layoutDirection : Defines the direction of layout drawing. [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml
deleted file mode 100644
index 3f9d6b537..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:mar="50dp"
- android:wi="100"
- mar="60dp"
- />
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt
deleted file mode 100644
index 9189a827c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completion9.xml for android:layout_wi^dth=:
-android:layout_width : Specifies the basic width of the view. [dimension, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt
deleted file mode 100644
index c6ee31dbe..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt
+++ /dev/null
@@ -1 +0,0 @@
-Code completion in completion9.xml for android:drawable^Top:
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
deleted file mode 100644
index 2085e96da..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-Code completion in completion9.xml for ^<Button:
-<AbsoluteLayout ></AbsoluteLayout>
-<AdapterViewFlipper ></AdapterViewFlipper>
-<AnalogClock />
-<AutoCompleteTextView />
-<Button />
-<CalendarView />
-<CheckBox />
-<CheckedTextView />
-<Chronometer />
-<DatePicker />
-<DialerFilter ></DialerFilter>
-<DigitalClock />
-<EditText />
-<ExpandableListView ></ExpandableListView>
-<FrameLayout ></FrameLayout>
-<Gallery />
-<GridLayout ></GridLayout>
-<GridView ></GridView>
-<HorizontalScrollView ></HorizontalScrollView>
-<ImageButton />
-<ImageSwitcher ></ImageSwitcher>
-<ImageView />
-<LinearLayout ></LinearLayout>
-<ListView ></ListView>
-<MediaController ></MediaController>
-<MultiAutoCompleteTextView />
-<NumberPicker />
-<ProgressBar />
-<QuickContactBadge />
-<RadioButton />
-<RadioGroup ></RadioGroup>
-<RatingBar />
-<RelativeLayout ></RelativeLayout>
-<ScrollView ></ScrollView>
-<SearchView ></SearchView>
-<SeekBar />
-<SlidingDrawer ></SlidingDrawer> : SlidingDrawer specific attributes.
-<Space />
-<Spinner />
-<StackView ></StackView>
-<SurfaceView />
-<Switch />
-<TabHost ></TabHost>
-<TabWidget ></TabWidget>
-<TableLayout ></TableLayout>
-<TableRow ></TableRow>
-<TextSwitcher ></TextSwitcher>
-<TextView />
-<TextureView />
-<TimePicker />
-<ToggleButton />
-<TwoLineListItem />
-<VideoView />
-<View /> : Attributes that can be used with android.view.View or any of its subclasses.
-<ViewAnimator ></ViewAnimator>
-<ViewFlipper ></ViewFlipper>
-<ViewStub /> : A android.view.ViewStub lets you lazily include other XML layouts inside your application at runtime.
-<ViewSwitcher ></ViewSwitcher>
-<WebView />
-<ZoomButton />
-<ZoomControls />
-<android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
-<fragment /> : A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity
-<include /> : Lets you statically include XML layouts inside other XML layouts.
-<merge ></merge> : A root tag useful for XML layouts inflated using a ViewStub.
-<requestFocus /> : Requests focus for the parent element or one of its descendants
-<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml
deleted file mode 100644
index 9040d8c1f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<com.google.android.apps.iosched.ui.widget.DashboardLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <Button android:id="@+id/home_btn_schedule"
- style="@style/DashboardButton"
- android:text="@string/btn_schedule"
- android:drawableTop="@drawable/home_btn_schedule" />
-</com.google.android.apps.iosched.ui.widget.DashboardLayout>
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
deleted file mode 100644
index d3232190c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for android:textS^ize selecting android:textSelectHandleLeft:
-@@ -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
deleted file mode 100644
index ac71df7eb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for 17^sp selecting 17mm:
-@@ -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
deleted file mode 100644
index df6fceb9e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for textColor">^@color/title_color</item> selecting @android::
-@@ -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
deleted file mode 100644
index 36fce8b9e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:shadowColor">@an^</item> selecting @android::
-@@ -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
deleted file mode 100644
index 6315fc4fd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:gravity">^ </item> selecting center_vertical:
-@@ -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
deleted file mode 100644
index 1db9773a1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:gravity"> ^</item> selecting left:
-@@ -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
deleted file mode 100644
index 63076464d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="gr^"> selecting android:gravity:
-@@ -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
deleted file mode 100644
index c8a119fd9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="an^"> selecting android:animateOnClick:
-@@ -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
deleted file mode 100644
index 9b3743807..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item ^></item> selecting name:
-@@ -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
deleted file mode 100644
index b34a8ec5c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="^"></item> selecting android:background:
-@@ -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
deleted file mode 100644
index b78adee5b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:allowSingleTap">^</item> selecting true:
-@@ -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
deleted file mode 100644
index 5af6c92d5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">^ false </item> selecting true:
-@@ -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
deleted file mode 100644
index f48f10143..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> ^false </item> selecting true:
-@@ -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
deleted file mode 100644
index 8c246a8ff..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> f^alse </item> selecting false:
-@@ -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
deleted file mode 100644
index 082f2b25c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:orientation">h^</item> selecting horizontal:
-@@ -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
deleted file mode 100644
index 47580e1d8..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for c^ selecting 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
deleted file mode 100644
index 57fe472e5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues1.xml for [^false] selecting true:
-@@ -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-completion23.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt
deleted file mode 100644
index a2f64dc72..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in completionvalues1.xml for android:textS^ize:
-android:textScaleX : Sets the horizontal scaling factor for the text. [float]
-android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
-android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
-android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
-android:textSize : Size of the text. [dimension]
-android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt
deleted file mode 100644
index c1de9ec99..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in completionvalues1.xml for 17^sp:
-17dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
-17sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
-17pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
-17mm : <b>Millimeters</b> - based on the physical size of the screen.
-17in : <b>Inches</b> - based on the physical size of the screen.
-17px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt
deleted file mode 100644
index b57246dd0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Code completion in completionvalues1.xml for textColor">^@color/title_color</item>:
-@android:
-@+id/
-@drawable/
-@id/
-@layout/
-@string/
-@style/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt
deleted file mode 100644
index b1c541c38..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:shadowColor">@an^</item>:
-@android:
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt
deleted file mode 100644
index 22b636ddf..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:gravity">^ </item>:
-top
-bottom
-left
-right
-center_vertical
-fill_vertical
-center_horizontal
-fill_horizontal
-center
-fill
-clip_vertical
-clip_horizontal
-start
-end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt
deleted file mode 100644
index 2a850294d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:gravity"> ^</item>:
-top
-bottom
-left
-right
-center_vertical
-fill_vertical
-center_horizontal
-fill_horizontal
-center
-fill
-clip_vertical
-clip_horizontal
-start
-end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt
deleted file mode 100644
index c082ce44b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completionvalues1.xml for <item name="gr^">:
-android:gravity : Specifies how to place the content of an object, both on the x- and y-axis, within the object itself. [flag]
-android:groupIndicator : Indicator shown beside the group View. [reference]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
deleted file mode 100644
index efee2bcf5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Code completion in completionvalues1.xml for <item name="an^">:
-android:
-android:animateFirstView : Defines whether to animate the current View when the ViewAnimation is first displayed. [boolean]
-android:animateLayoutChanges : Defines whether changes in layout (caused by adding and removing items) should cause a LayoutTransition to run. [boolean]
-android:animateOnClick : Indicates whether the drawer should be opened/closed with an animation when the user clicks the handle. [boolean]
-android:animationCache : Defines whether layout animations should create a drawing cache for their children. [boolean]
-android:animationDuration : Sets how long a transition animation should run (in milliseconds) when layout has changed. [integer]
-android:animationResolution : Timeout between frames of animation in milliseconds * Deprecated: Not used by the framework. [integer]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt
deleted file mode 100644
index 90441643c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completionvalues1.xml for <item ^></item>:
-name : The mandatory name used in referring to this item.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
deleted file mode 100644
index 57684d7ce..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
+++ /dev/null
@@ -1,317 +0,0 @@
-Code completion in completionvalues1.xml for <item name="^"></item>:
-android:
-android:addStatesFromChildren : Sets whether this ViewGroup's drawable states also include its children's drawable states. [boolean]
-android:adjustViewBounds : Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable. [boolean]
-android:alignmentMode : When set to alignMargins, causes alignment to take place between the outer boundary of a view, as defined by its margins. [enum]
-android:allowSingleTap : Indicates whether the drawer can be opened/closed by a single tap on the handle. [boolean]
-android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
-android:alwaysDrawnWithCache : Defines whether the ViewGroup should always draw its children using their drawing cache or not. [boolean]
-android:animateFirstView : Defines whether to animate the current View when the ViewAnimation is first displayed. [boolean]
-android:animateLayoutChanges : Defines whether changes in layout (caused by adding and removing items) should cause a LayoutTransition to run. [boolean]
-android:animateOnClick : Indicates whether the drawer should be opened/closed with an animation when the user clicks the handle. [boolean]
-android:animationCache : Defines whether layout animations should create a drawing cache for their children. [boolean]
-android:animationDuration : Sets how long a transition animation should run (in milliseconds) when layout has changed. [integer]
-android:animationResolution : Timeout between frames of animation in milliseconds * Deprecated: Not used by the framework. [integer]
-android:autoLink : Controls whether links such as urls and email addresses are automatically found and converted to clickable links. [flag]
-android:autoStart : When true, automatically start animating [boolean]
-android:autoText : If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. * Deprecated: Use inputType instead. [boolean]
-android:background : A drawable to use as the background. [color, reference]
-android:baseline : The offset of the baseline within this view. [dimension]
-android:baselineAlignBottom : If true, the image view will be baseline aligned with based on its bottom edge. [boolean]
-android:baselineAligned : When set to false, prevents the layout from aligning its children's baselines. [boolean]
-android:baselineAlignedChildIndex : When a linear layout is part of another layout that is baseline aligned, it can specify which of its children to baseline align to (that is, which child TextView). [integer]
-android:bottomOffset : Extra offset for the handle at the bottom of the SlidingDrawer. [dimension]
-android:bufferType : Determines the minimum type that getText() will return. [enum]
-android:button : Drawable used for the button graphic (e.g. checkbox, radio button, etc). [reference]
-android:cacheColorHint : Indicates that this list will always be drawn on top of solid, single-color opaque background. [color]
-android:calendarViewShown : Whether the calendar view is shown. [boolean]
-android:capitalize : If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. * Deprecated: Use inputType instead. [enum]
-android:checkMark : Drawable used for the check mark graphic. [reference]
-android:checked : Indicates the initial checked state of this button. [boolean]
-android:checkedButton : The id of the child radio button that should be checked by default within this radio group. [integer]
-android:childDivider : Drawable or color that is used as a divider for children. [color, reference]
-android:childIndicator : Indicator shown beside the child View. [reference]
-android:childIndicatorLeft : The left bound for a child's indicator. [dimension]
-android:childIndicatorRight : The right bound for a child's indicator. [dimension]
-android:choiceMode : Defines the choice behavior for the view. [enum]
-class : Supply the name of the view class to instantiate
-android:clickColor : Color of the outline of click feedback. [color]
-android:clickable : Defines whether this view reacts to click events. [boolean]
-android:clipChildren : Defines whether a child is limited to draw inside of its bounds or not. [boolean]
-android:clipToPadding : Defines whether the ViewGroup will clip its drawing surface so as to exclude the padding area. [boolean]
-android:collapseColumns : The zero-based index of the columns to collapse. [string]
-android:columnCount : The maxmimum number of columns to create when automatically positioning children. [integer]
-android:columnOrderPreserved : When set to true, forces column boundaries to appear in the same order as column indices. [boolean]
-android:columnWidth : Specifies the fixed width for each column. [dimension]
-android:completionHint : Defines the hint displayed in the drop down menu. [string]
-android:completionHintView : Defines the hint view displayed in the drop down menu. [reference]
-android:completionThreshold : Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu. [integer]
-android:content : Identifier for the child that represents the drawer's content. [reference]
-android:contentDescription : Defines text that briefly describes content of the view. [string]
-android:cropToPadding : If true, the image will be cropped to fit within its padding. [boolean]
-android:cursorVisible : Makes the cursor visible (the default) or invisible. [boolean]
-android:dateTextAppearance : The text appearance for the calendar dates. [reference]
-android:descendantFocusability : Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus. [enum]
-android:dial : [reference]
-android:digits : If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. [string]
-android:disableChildrenWhenDisabled : Whether this spinner should mark child views as enabled/disabled when the spinner itself is enabled/disabled. [boolean]
-android:disabledAlpha : The alpha to apply to the indicator when disabled. [float]
-android:divider : Drawable to use as a vertical divider between buttons.
-android:dividerHeight : Height of the divider. [dimension]
-android:dividerPadding : Size of padding on either end of a divider. [dimension]
-android:drawSelectorOnTop : When set to true, the selector will be drawn over the selected item. [boolean]
-android:drawableBottom : The drawable to be drawn below the text. [color, reference]
-android:drawableEnd : The drawable to be drawn to the end of the text. [color, reference]
-android:drawableLeft : The drawable to be drawn to the left of the text. [color, reference]
-android:drawablePadding : The padding between the drawables and the text. [dimension]
-android:drawableRight : The drawable to be drawn to the right of the text. [color, reference]
-android:drawableStart : The drawable to be drawn to the start of the text. [color, reference]
-android:drawableTop : The drawable to be drawn above the text. [color, reference]
-android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
-android:dropDownAnchor : View to anchor the auto-complete dropdown to. [reference]
-android:dropDownHeight : Specifies the basic height of the dropdown. [dimension, enum]
-android:dropDownHorizontalOffset : Horizontal offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". [dimension]
-android:dropDownSelector : List selector to use for spinnerMode="dropdown" display. [color, reference]
-android:dropDownVerticalOffset : Vertical offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". [dimension]
-android:dropDownWidth : Width of the dropdown in spinnerMode="dropdown". [dimension, enum]
-android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
-android:editable : If set, specifies that this TextView has an input method. * Deprecated: Use inputType instead. [boolean]
-android:editorExtras : Reference to an "input-extras" XML resource containing additional data to supply to an input method, which is private to the implementation of the input method. [reference]
-android:ellipsize : If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. [enum]
-android:ems : Makes the TextView be exactly this many ems wide. [integer]
-android:enabled : Specifies whether the widget is enabled. [boolean]
-android:endYear : The last year (inclusive), for example "2010". * Deprecated: Use maxDate instead. [integer]
-android:entries : Reference to an array resource that will populate the Spinner. [reference]
-android:eventsInterceptionEnabled : Defines whether the overlay should intercept the motion events when a gesture is recognized. [boolean]
-android:fadeDuration : Duration, in milliseconds, of the fade out effect after the user is done drawing a gesture. [integer]
-android:fadeEnabled : Defines whether the gesture will automatically fade out after being recognized. [boolean]
-android:fadeOffset : Time, in milliseconds, to wait before the gesture fades out after the user is done drawing it. [integer]
-android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
-android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
-android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
-android:fastScrollAlwaysVisible : When set to true, the list will always show the fast scroll interface. [boolean]
-android:fastScrollEnabled : Enables the fast scroll thumb that can be dragged to quickly scroll through the list. [boolean]
-android:fillViewport : Defines whether the scrollview should stretch its content to fill the viewport. [boolean]
-android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
-android:firstDayOfWeek : The first day of week according to java.util.Calendar. [integer]
-android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
-android:flipInterval : [integer]
-android:focusable : Boolean that controls whether a view can take focus. [boolean]
-android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
-android:focusedMonthDateColor : The color for the dates of the focused month. [color, reference]
-android:fontFamily : Font family (named by string) for the text. [string]
-android:footerDividersEnabled : When set to false, the ListView will not draw the divider before each footer view. [boolean]
-android:foreground : Defines the drawable to draw over the content. [color, reference]
-android:foregroundGravity : Defines the gravity to apply to the foreground drawable. [flag]
-android:foregroundInsidePadding : Defines whether the foreground drawable should be drawn inside the padding. [boolean]
-android:format : Format string: if specified, the Chronometer will display this string, with the first "%s" replaced by the current timer value in "MM:SS" or "H:MM:SS" form. [string]
-android:freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. [boolean]
-android:gestureColor : Color used to draw a gesture. [color]
-android:gestureStrokeAngleThreshold : Minimum curve angle a stroke must contain before it is recognized as a gesture. [float]
-android:gestureStrokeLengthThreshold : Minimum length of a stroke before it is recognized as a gesture. [float]
-android:gestureStrokeSquarenessThreshold : Squareness threshold of a stroke before it is recognized as a gesture. [float]
-android:gestureStrokeType : Defines the type of strokes that define a gesture. [enum]
-android:gestureStrokeWidth : Width of the stroke used to draw the gesture. [float]
-android:gravity : Specifies how to place the content of an object, both on the x- and y-axis, within the object itself. [flag]
-android:groupIndicator : Indicator shown beside the group View. [reference]
-android:hand_hour : [reference]
-android:hand_minute : [reference]
-android:handle : Identifier for the child that represents the drawer's handle. [reference]
-android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
-android:headerDividersEnabled : When set to false, the ListView will not draw the divider after each header view. [boolean]
-android:height : Makes the TextView be exactly this many pixels tall. [dimension]
-android:hint : Hint text to display when the text is empty. [string]
-android:horizontalSpacing : Defines the default horizontal spacing between columns. [dimension]
-android:iconifiedByDefault : The default state of the SearchView. [boolean]
-android:id : Supply an identifier name for the top-level view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
-android:ignoreGravity : Indicates what view should not be affected by gravity. [reference]
-android:imeActionId : Supply a value for EditorInfo.actionId used when an input method is connected to the text view. [integer]
-android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view. [string]
-android:imeOptions : Additional features you can enable in an IME associated with an editor to improve the integration with your application. [flag]
-android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
-android:inAnimation : Identifier for the animation to use when a view is shown. [reference]
-android:includeFontPadding : Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolean]
-android:indeterminate : Allows to enable the indeterminate mode. [boolean]
-android:indeterminateBehavior : Defines how the indeterminate mode should behave when the progress reaches max. [enum]
-android:indeterminateDrawable : Drawable used for the indeterminate mode. [reference]
-android:indeterminateDuration : Duration of the indeterminate animation. [integer]
-android:indeterminateOnly : Restricts to ONLY indeterminate mode (state-keeping progress mode will not work). [boolean]
-android:indicatorLeft : The left bound for an item's indicator. [dimension]
-android:indicatorRight : The right bound for an item's indicator. [dimension]
-android:inflatedId : Overrides the id of the inflated View with this value. [reference]
-android:inputMethod : If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). * Deprecated: Use inputType instead. [string]
-android:inputType : The type of data being placed in a text field, used to help an input method decide how to let the user enter text. [flag]
-android:interpolator : [reference]
-android:isIndicator : Whether this rating bar is an indicator (and non-changeable by the user). [boolean]
-android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
-android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
-android:layerType : Specifies the type of layer backing this view. [enum]
-layout : [reference]. * Required.
-android:layoutAnimation : Defines the layout animation to use the first time the ViewGroup is laid out. [reference]
-android:layoutDirection : Defines the direction of layout drawing. [enum]
-android:lineSpacingExtra : Extra spacing between lines of text. [dimension]
-android:lineSpacingMultiplier : Extra spacing between lines of text, as a multiplier. [float]
-android:lines : Makes the TextView be exactly this many lines tall. [integer]
-android:linksClickable : If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. [boolean]
-android:listSelector : Drawable used to indicate the currently selected item in the list. [color, reference]
-android:longClickable : Defines whether this view reacts to long click events. [boolean]
-android:loopViews : Defines whether the animator loops to the first view once it has reached the end of the list. [boolean]
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
-android:max : Defines the maximum value the progress can take. [integer]
-android:maxDate : The minimal date shown by this calendar view in mm/dd/yyyy format. [string]
-android:maxEms : Makes the TextView be at most this many ems wide. [integer]
-android:maxHeight : An optional argument to supply a maximum height for this view. [dimension]
-android:maxLength : Set an input filter to constrain the text length to the specified number. [integer]
-android:maxLines : Makes the TextView be at most this many lines tall. [integer]
-android:maxWidth : An optional argument to supply a maximum width for this view. [dimension]
-android:measureAllChildren : Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring. [boolean]
-android:measureWithLargestChild : When set to true, all children with a weight will be considered having the minimum size of the largest child. [boolean]
-android:minDate : The minimal date shown by this calendar view in mm/dd/yyyy format. [string]
-android:minEms : Makes the TextView be at least this many ems wide. [integer]
-android:minHeight : Defines the minimum height of the view.
-android:minLines : Makes the TextView be at least this many lines tall. [integer]
-android:minWidth : Defines the minimum width of the view.
-android:mode : [enum]
-android:name : Supply the name of the fragment class to instantiate.
-android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
-android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
-android:numColumns : Defines how many columns to show. [integer, enum]
-android:numStars : The number of stars (or rating items) to show. [integer]
-android:numeric : If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead. [flag]
-android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
-android:orientation : Should the layout be a column or a row? Use "horizontal" for a row, "vertical" for a column. [enum]
-android:outAnimation : Identifier for the animation to use when a view is hidden. [reference]
-android:overScrollFooter : Drawable to draw below list content. [color, reference]
-android:overScrollHeader : Drawable to draw above list content. [color, reference]
-android:overScrollMode : Defines over-scrolling behavior. [enum]
-android:padding : Sets the padding, in pixels, of all four edges. [dimension]
-android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
-android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
-android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
-android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
-android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
-android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
-android:password : Whether the characters of the field are displayed as password dots instead of themselves. * Deprecated: Use inputType instead. [boolean]
-android:persistentDrawingCache : Defines the persistence of the drawing cache. [flag]
-android:phoneNumber : If set, specifies that this TextView has a phone number input method. * Deprecated: Use inputType instead. [boolean]
-android:popupBackground : Background drawable to use for the dropdown in spinnerMode="dropdown". [color, reference]
-android:popupPromptView : Reference to a layout to use for displaying a prompt in the dropdown for spinnerMode="dropdown". [reference]
-android:privateImeOptions : An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method. [string]
-android:progress : Defines the default progress value, between 0 and max. [integer]
-android:progressDrawable : Drawable used for the progress mode. [reference]
-android:prompt : The prompt to display when the spinner's dialog is shown. [reference]
-android:queryHint : An optional query hint string to be displayed in the empty query field. [string]
-android:quickContactWindowSize : [enum]
-android:rating : The rating to set by default. [float]
-android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
-android:resOutColor : Color of the res-out outline. [color]
-android:rotation : rotation of the view, in degrees. [float]
-android:rotationX : rotation of the view around the x axis, in degrees. [float]
-android:rotationY : rotation of the view around the y axis, in degrees. [float]
-android:rowCount : The maxmimum number of rows to create when automatically positioning children. [integer]
-android:rowOrderPreserved : When set to true, forces row boundaries to appear in the same order as row indices. [boolean]
-android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
-android:scaleType : Controls how the image should be resized or moved to match the size of this ImageView. [enum]
-android:scaleX : scale of the view in the x direction. [float]
-android:scaleY : scale of the view in the y direction. [float]
-android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). [boolean]
-android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
-android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
-android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
-android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
-android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
-android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
-android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
-android:scrollbarStyle : Controls the scrollbar style and position. [enum]
-android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
-android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
-android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
-android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
-android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
-android:scrollingCache : When set to true, the list uses a drawing cache during scrolling. [boolean]
-android:secondaryProgress : Defines the secondary progress value, between 0 and max. [integer]
-android:selectAllOnFocus : If the text is selectable, select it all when the view takes focus. [boolean]
-android:selectedDateVerticalBar : Drawable for the vertical bar shown at the beginning and at the end of the selected date. [reference]
-android:selectedWeekBackgroundColor : The background color for the selected week. [color, reference]
-android:shadowColor : Place a shadow of the specified color behind the text. [color]
-android:shadowDx : Horizontal offset of the shadow. [float]
-android:shadowDy : Vertical offset of the shadow. [float]
-android:shadowRadius : Radius of the shadow. [float]
-android:showDividers : Setting for which dividers to show. [flag]
-android:showWeekNumber : Whether do show week numbers. [boolean]
-android:shownWeekCount : The number of weeks to be shown. [integer]
-android:shrinkColumns : The zero-based index of the columns to shrink. [string]
-android:singleLine : Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layo...
-android:smoothScrollbar : When set to true, the list will use a more refined calculation method based on the pixels height of the items visible on screen. [boolean]
-android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
-android:spacing : [dimension]
-android:spinnerMode : Display mode for spinner options. [enum]
-android:spinnersShown : Whether the spinners are shown. [boolean]
-android:splitMotionEvents : Sets whether this ViewGroup should split MotionEvents to separate child views during touch event dispatch. [boolean]
-android:src : Sets a drawable as the content of this ImageView. [color, reference]
-android:stackFromBottom : Used by ListView and GridView to stack their content from the bottom. [boolean]
-android:startYear : The first year (inclusive), for example "1940". * Deprecated: Use minDate instead. [integer]
-android:stepSize : The step size of the rating. [float]
-android:stretchColumns : The zero-based index of the columns to stretch. [string]
-android:stretchMode : Defines how columns should stretch to fill the available empty space, if any. [enum]
-style : A reference to a custom style [reference]
-android:switchMinWidth : Minimum width for the switch component [dimension]
-android:switchPadding : Minimum space between the switch and caption text [dimension]
-android:switchTextAppearance : TextAppearance style for text displayed on the switch thumb. [reference]
-android:tabLayout : Layout used to organize each tab's content. [reference]
-android:tabStripEnabled : Determines whether the strip under the tab indicators is drawn or not. [boolean]
-android:tabStripLeft : Drawable used to draw the left part of the strip underneath the tabs. [reference]
-android:tabStripRight : Drawable used to draw the right part of the strip underneath the tabs. [reference]
-android:tag : Supply a tag for the top-level view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
-android:text : Text to display. [string]
-android:textAlignment : Alignment of the text. [integer, enum]
-android:textAllCaps : Present the text in ALL CAPS. [boolean]
-android:textAppearance : Base text color, typeface, size, and style. [reference]
-android:textColor : Text color. [color, reference]
-android:textColorHighlight : Color of the text selection highlight. [color, reference]
-android:textColorHint : Color of the hint text. [color, reference]
-android:textColorLink : Text color for links. [color, reference]
-android:textCursorDrawable : Reference to a drawable that will be drawn under the insertion cursor. [reference]
-android:textDirection : Direction of the text. [integer, enum]
-android:textEditNoPasteWindowLayout : Variation of textEditPasteWindowLayout displayed when the clipboard is empty. [reference]
-android:textEditPasteWindowLayout : The layout of the view that is displayed on top of the cursor to paste inside a TextEdit field. [reference]
-android:textEditSideNoPasteWindowLayout : Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. [reference]
-android:textEditSidePasteWindowLayout : Used instead of textEditPasteWindowLayout when the window is moved on the side of the insertion cursor because it would be clipped if it were positioned on top. [reference]
-android:textEditSuggestionItemLayout : Layout of the TextView item that will populate the suggestion popup window. [reference]
-android:textFilterEnabled : When set to true, the list will filter results as the user types. [boolean]
-android:textIsSelectable : Indicates that the content of a non-editable text can be selected. [boolean]
-android:textOff : The text for the button when it is not checked. [string]
-android:textOn : The text for the button when it is checked. [string]
-android:textScaleX : Sets the horizontal scaling factor for the text. [float]
-android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
-android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
-android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
-android:textSize : Size of the text. [dimension]
-android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
-android:thumb : Drawable to use as the "thumb" that switches back and forth. [reference]
-android:thumbOffset : An offset for the thumb that allows it to extend out of the range of the track. [dimension]
-android:thumbTextPadding : Amount of padding on either side of text within the switch thumb. [dimension]
-android:tint : Set a tinting color for the image. [color]
-android:topOffset : Extra offset for the handle at the top of the SlidingDrawer. [dimension]
-android:track : Drawable to use as the "track" that the switch thumb slides within. [reference]
-android:transcriptMode : Sets the transcript mode for the list. [enum]
-android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
-android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
-android:translationX : translation in x of the view. [dimension]
-android:translationY : translation in y of the view. [dimension]
-android:typeface : Typeface (normal, sans, serif, monospace) for the text. [enum]
-android:uncertainGestureColor : Color used to draw the user's strokes until we are sure it's a gesture. [color]
-android:unfocusedMonthDateColor : The color for the dates of an unfocused month. [color, reference]
-android:unselectedAlpha : Sets the alpha on the items that are not selected. [float]
-android:useDefaultMargins : When set to true, tells GridLayout to use default margins when none are specified in a view's layout parameters. [boolean]
-android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
-android:verticalSpacing : Defines the default vertical spacing between rows. [dimension]
-android:visibility : Controls the initial visibility of the view. [enum]
-android:weekDayTextAppearance : The text appearance for the week day abbreviation of the calendar header. [reference]
-android:weekNumberColor : The color for the week numbers. [color, reference]
-android:weekSeparatorLineColor : The color for the separator line between weeks. [color, reference]
-android:weightSum : Defines the maximum weight sum. [float]
-android:width : Makes the TextView be exactly this many pixels wide. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt
deleted file mode 100644
index f9c008d25..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:allowSingleTap">^</item>:
-true
-false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt
deleted file mode 100644
index 861a41334..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">^ false </item>:
-true
-false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt
deleted file mode 100644
index 25e8a0b1d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> ^false </item>:
-true
-false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt
deleted file mode 100644
index d85133f57..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> f^alse </item>:
-false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt
deleted file mode 100644
index 1d4135106..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completionvalues1.xml for <item name="android:orientation">h^</item>:
-horizontal
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt
deleted file mode 100644
index 8819bcd39..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Code completion in completionvalues1.xml for c^:
-center_vertical
-center_horizontal
-center
-clip_vertical
-clip_horizontal
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt
deleted file mode 100644
index 4f29a8b71..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in completionvalues1.xml for 17[^sp]:
-17dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
-17sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
-17pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
-17mm : <b>Millimeters</b> - based on the physical size of the screen.
-17in : <b>Inches</b> - based on the physical size of the screen.
-17px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt
deleted file mode 100644
index 4f29a8b71..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in completionvalues1.xml for 17[^sp]:
-17dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
-17sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
-17pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
-17mm : <b>Millimeters</b> - based on the physical size of the screen.
-17in : <b>Inches</b> - based on the physical size of the screen.
-17px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt
deleted file mode 100644
index 5aa1d43c1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completionvalues1.xml for [^false]:
-true
-false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml
deleted file mode 100644
index 89b5f4609..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
- <style name="stylename">
- <item name="android:textSize">17sp</item>
- <item name="android:textColor">@color/title_color</item>
- <item name="android:shadowColor">@an</item>
- <item name="android:gravity"> </item>
- <item name="gr">@color/title_color</item>
- <item name="an">@color/title_color</item>
- <item ></item>
- <item name=""></item>
- <item name="android:allowSingleTap"></item>
- <item name="android:alwaysDrawnWithCache"> false </item>
- <item name="android:orientation">h</item>
- <item name="android:gravity">
- c
- </item>
- </style>
-</resources>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff
deleted file mode 100644
index 649866860..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in completionvalues2.xml for @string/^app_name selecting @string/hello:
-< <item name="main_layout5" type="string">@string/^app_name</item>
----
-> <item name="main_layout5" type="string">@string/hello^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt
deleted file mode 100644
index 20f8a7442..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in completionvalues2.xml for <item name="main_layout4" type="layout">^</item>:
-@android:
-@layout/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt
deleted file mode 100644
index c491feabe..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Code completion in completionvalues2.xml for <item name="main_layout5" type="string">@string/^app_name</item>:
-@string/app_name
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml
deleted file mode 100644
index 293abc01a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <item name="main_layout" type="layout">@layout/main2</item>
- <item name="main_layout2" type="layout"> @layout/main_layout </item>
- <item name="main_layout3" type="layout"> </item>
- <item name="main_layout4" type="layout"></item>
- <item name="main_layout5" type="string">@string/app_name</item>
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt
deleted file mode 100644
index c7f495b1b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Code completion in drawable1.xml for ^<layer-list:
-<animation-list /> : Drawable used to render several animated frames.
-<bitmap /> : Drawable used to draw bitmaps.
-<clip />
-<color /> : Drawable used to draw a single color.
-<inset />
-<layer-list ></layer-list> : Drawable used to render several drawables stacked on top of each other.
-<nine-patch /> : Drawable used to draw 9-patches.
-<rotate /> : Drawable used to rotate another drawable.
-<scale />
-<selector ></selector> : Drawable used to render several states.
-<shape ></shape> : Drawable used to render a geometric shape, with a gradient or a solid color.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt
deleted file mode 100644
index 024cdebe4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in drawable1.xml for ^xmlns:android:
-android:opacity : Indicates the opacity of the layer. [enum]
-xmlns:android
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt
deleted file mode 100644
index 269fd86f0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in drawable1.xml for <item ^></item>:
-android:left : Left coordinate of the layer. [dimension]
-android:top : Top coordinate of the layer. [dimension]
-android:right : Right coordinate of the layer. [dimension]
-android:bottom : Bottom coordinate of the layer. [dimension]
-android:drawable : Drawable used to render the layer. [reference]
-android:id : Identifier of the layer. [reference]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt
deleted file mode 100644
index d05bc768c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Code completion in drawable1.xml for <item >^</item>:
-<animation-list /> : Drawable used to render several animated frames.
-<bitmap /> : Drawable used to draw bitmaps.
-<clip />
-<color /> : Drawable used to draw a single color.
-<inset />
-<layer-list ></layer-list> : Drawable used to render several drawables stacked on top of each other.
-<nine-patch /> : Drawable used to draw 9-patches.
-<rotate /> : Drawable used to rotate another drawable.
-<scale />
-<selector ></selector> : Drawable used to render several states.
-<shape ></shape> : Drawable used to render a geometric shape, with a gradient or a solid color.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml
deleted file mode 100644
index 9513f1709..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layer-list
- xmlns:android="http://schemas.android.com/apk/res/android">
- <item ></item>
-</layer-list>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt
deleted file mode 100644
index 438bd768c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Code completion in drawable2.xml for ^android:innerRadiusRatio="2":
-android:visible : Indicates whether the drawable should intially be visible. [boolean]
-android:dither : Enables or disables dithering. [boolean]
-android:shape : Indicates what shape to fill with a gradient. [enum]
-android:innerRadiusRatio : Inner radius of the ring expressed as a ratio of the ring's width. [float]
-android:thicknessRatio : Thickness of the ring expressed as a ratio of the ring's width. [float]
-android:innerRadius : Inner radius of the ring. [dimension]
-android:thickness : Thickness of the ring. [dimension]
-android:useLevel : Indicates whether the drawable's level affects the way the gradient is drawn.
-xmlns:android
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt
deleted file mode 100644
index 2a2853363..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Code completion in drawable2.xml for ^<gradient:
-<corners /> : Describes the corners for the rectangle shape of a GradientDrawable.
-<gradient /> : Used to describe the gradient used to fill the shape of a GradientDrawable.
-<padding /> : Used to specify the optional padding of a GradientDrawable.
-<size /> : Used to specify the size of the shape for GradientDrawable.
-<solid /> : Used to fill the shape of GradientDrawable with a solid color.
-<stroke /> : Used to describe the optional stroke of a GradientDrawable.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml
deleted file mode 100644
index c6a672fd8..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:innerRadiusRatio="2">
- <gradient />
-</shape>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml
deleted file mode 100644
index 0488fd6f1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
-</LinearLayout>
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
deleted file mode 100644
index e21c594d1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
+++ /dev/null
@@ -1,34 +0,0 @@
-@@ -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
deleted file mode 100644
index 8c12b7cde..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-@@ -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
deleted file mode 100644
index c819b09aa..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-@@ -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
deleted file mode 100644
index c819b09aa..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-@@ -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
deleted file mode 100644
index 36186b83f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-@@ -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
deleted file mode 100644
index 83837f57b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-@@ -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
deleted file mode 100644
index 55d658ddd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-@@ -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-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff
deleted file mode 100644
index 1db5e3811..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff
+++ /dev/null
@@ -1,6 +0,0 @@
-< <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 style="@style/newstyle" android:id="@+id/button1" ></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
deleted file mode 100644
index 8c12b7cde..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-@@ -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.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info
deleted file mode 100644
index 69f773989..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info
+++ /dev/null
@@ -1,3 +0,0 @@
-android.widget.LinearLayout [0,36,140,320] <LinearLayout>
- android.widget.Button [0,0,140,62] <Button>
- android.widget.Button [0,62,140,284] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml
deleted file mode 100644
index 64c49b2c1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- 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>
-</FrameLayout>
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
deleted file mode 100644
index bb2960e48..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
+++ /dev/null
@@ -1,33 +0,0 @@
-@@ -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/extractstyle2.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info
deleted file mode 100644
index 69f773989..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info
+++ /dev/null
@@ -1,3 +0,0 @@
-android.widget.LinearLayout [0,36,140,320] <LinearLayout>
- android.widget.Button [0,0,140,62] <Button>
- android.widget.Button [0,62,140,284] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml
deleted file mode 100644
index 3cb966f30..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<LinearLayout xmlns:foo="http://schemas.android.com/apk/res/android"
- 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>
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff
deleted file mode 100644
index 3ed60f13d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff
+++ /dev/null
@@ -1,4 +0,0 @@
-Code completion in fragmentlayout.xml for class="^com selecting android.app.ListFragment:
-@@ -16 +16
-- <fragment class="^com.android.eclipse.tests.TestFragment"
-+ <fragment class="android.app.ListFragment^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt
deleted file mode 100644
index 6e8687f4f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Code completion in fragmentlayout.xml for android:name="^com:
-android.app.DialogFragment : <p>Implementations should override this class and implement <code><a href="/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)">onCreateView(LayoutInflater, ViewGroup, Bundle)</a></code> to supply ...
-android.app.ListFragment : <p> ListFragment hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can be bound to different data sources, typically either an array or a Cursor holding query results. Binding, screen layout, and row layout are discussed ...
-android.preference.PreferenceFragment : <p> Furthermore, the preferences shown will follow the visual style of system preferences. It is easy to create a hierarchy of preferences (that can be shown on multiple screens) via XML. For these reasons, it is recommended to use this fragment (as a s...
-android.webkit.WebViewFragment : <p> The WebView is automically paused or resumed when the Fragment is paused or resumed. </p> </div><!-- jd-descr --> <div class="jd-descr"> <h2>Summary</h2> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <table id="...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt
deleted file mode 100644
index e02637c86..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Code completion in fragmentlayout.xml for class="^com:
-android.app.DialogFragment : <p>Implementations should override this class and implement <code><a href="/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)">onCreateView(LayoutInflater, ViewGroup, Bundle)</a></code> to supply ...
-android.app.ListFragment : <p> ListFragment hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can be bound to different data sources, typically either an array or a Cursor holding query results. Binding, screen layout, and row layout are discussed ...
-android.preference.PreferenceFragment : <p> Furthermore, the preferences shown will follow the visual style of system preferences. It is easy to create a hierarchy of preferences (that can be shown on multiple screens) via XML. For these reasons, it is recommended to use this fragment (as a s...
-android.webkit.WebViewFragment : <p> The WebView is automically paused or resumed when the Fragment is paused or resumed. </p> </div><!-- jd-descr --> <div class="jd-descr"> <h2>Summary</h2> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <table id="...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt
deleted file mode 100644
index ae30d58a3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Go To Declaration in fragmentlayout.xml for android:name="com.android.ecl^ipse.tests.TestFragment":
-Open XML Declaration : [com.android.eclipse.tests.TestFragment]
-
-
-After open, the selected text is:
-[^public class TestFragment extends Fragment {
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return null;
- }
-}]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt
deleted file mode 100644
index 0046483fc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Go To Declaration in fragmentlayout.xml for class="com.and^roid.eclipse.tests.TestFragment":
-Open XML Declaration : [com.android.eclipse.tests.TestFragment]
-
-
-After open, the selected text is:
-[^public class TestFragment extends Fragment {
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- return null;
- }
-}]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml
deleted file mode 100644
index 758599c9c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/home_root"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <LinearLayout android:orientation="vertical"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent">
- <fragment android:name="com.android.eclipse.tests.TestFragment"
- android:id="@+id/test_fragment"
- android:layout_marginLeft="20dp"
- android:layout_weight="1"
- android:layout_width="fill_parent"
- android:layout_height="0dp" />
- <fragment class="com.android.eclipse.tests.TestFragment"
- android:id="@+id/test_fragment2" />
- </LinearLayout>
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt
deleted file mode 100644
index cb1d0ce9d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Code completion in manifest.xml for <activity android:name="^.:
-android.accounts.AccountAuthenticatorActivity
-android.app.ActivityGroup
-android.app.AliasActivity
-android.app.ExpandableListActivity
-android.app.ListActivity
-android.app.NativeActivity
-android.app.TabActivity
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt
deleted file mode 100644
index 478e4357c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Code completion in manifest.xml for android.permission.ACC^ESS_NETWORK_STATE:
-android.permission.ACCESS_CHECKIN_PROPERTIES
-android.permission.ACCESS_COARSE_LOCATION
-android.permission.ACCESS_FINE_LOCATION
-android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
-android.permission.ACCESS_MOCK_LOCATION
-android.permission.ACCESS_NETWORK_STATE
-android.permission.ACCESS_SURFACE_FLINGER
-android.permission.ACCESS_WIFI_STATE
-android.permission.ACCOUNT_MANAGER
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt
deleted file mode 100644
index c6b35386d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Code completion in manifest.xml for android.intent.category.L^AUNCHER:
-android.intent.category.LAUNCHER
-android.intent.category.LE_DESK_DOCK
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt
deleted file mode 100644
index f3367c72a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Code completion in manifest.xml for <^application android:i:
-application : The "application" tag describes application-level components contained in the package, as well as general application attributes.
-compatible-screens
-instrumentation : Attributes that can be supplied in an AndroidManifest.xml "instrumentation" tag, a child of the root manifest tag.
-original-package : Private tag to declare the original package name that this package is based on.
-package-verifier : Attributes relating to a package verifier.
-permission : The "permission" tag declares a security permission that can be used to control access from other packages to specific components or features in your package (or other packages).
-permission-group : The "permission-group" tag declares a logical grouping of related permissions.
-permission-tree : The "permission-tree" tag declares the base of a tree of permission values: it declares that this package has ownership of the given permission name, as well as all names underneath it (separated by '.').
-protected-broadcast : Private tag to declare system protected broadcast actions.
-supports-screens : The "supports-screens" specifies the screen dimensions an application supports.
-uses-configuration : The "uses-configuration" tag specifies a specific hardware configuration value used by the application.
-uses-feature : The "uses-feature" tag specifies a specific feature used by the application.
-uses-permission : The "uses-permission" tag requests a "permission" that the containing package must be granted in order for it to operate correctly.
-uses-sdk : The "uses-sdk" tag describes the SDK features that the containing package must be running on to operate correctly.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt
deleted file mode 100644
index 8244f0a81..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Code completion in manifest.xml for ^android:versionCode="1":
-xmlns:android
-package : This attribute gives a unique name for the package, using a Java-style naming convention to avoid name collisions. For example, applications published by Google could have names of the form com.google.app.appname
-android:versionCode : Internal version code. [integer]
-android:versionName : The text shown to the user to indicate the version they have. [string]
-android:sharedUserId : Specify the name of a user ID that will be shared between multiple packages. [string]
-android:sharedUserLabel : Specify a label for the shared user UID of this package. [reference]
-android:installLocation : The default install location defined by an application. [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
deleted file mode 100644
index 12152445e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Code completion in manifest.xml for <activity android:^name=".TestActivity":
-android:name : Required name of the class implementing the activity, deriving from android.app.Activity. [string]. * Required.
-android:theme : The overall theme to use for an activity. [reference]
-android:label : A user-legible name for the given item. [string, reference]
-android:description : Descriptive text for the associated data. [reference]
-android:icon : [reference]
-android:logo : A Drawable resource providing an extended graphical logo for its associated item. [reference]
-android:launchMode : Specify how an activity should be launched. [enum]
-android:screenOrientation : Specify the orientation an activity should be run in. [enum]
-android:configChanges : Specify one or more configuration changes that the activity will handle itself. [flag]
-android:permission : Specify a permission that a client is required to have in order to use the associated object. [string]
-android:multiprocess : Specify whether a component is allowed to have multiple instances of itself running in different processes. [boolean]
-android:process : Specify a specific process that the associated code is to run in. [string]
-android:taskAffinity : Specify a task name that activities have an "affinity" to. [string]
-android:allowTaskReparenting : Specify that an activity can be moved out of a task it is in to the task it has an affinity for when appropriate. [boolean]
-android:finishOnTaskLaunch : Specify whether an activity should be finished when its task is brought to the foreground by relaunching from the home screen. [boolean]
-android:finishOnCloseSystemDialogs : Specify whether an activity should be finished when a "close system windows" request has been made. [boolean]
-android:clearTaskOnLaunch : Specify whether an activity's task should be cleared when it is re-launched from the home screen. [boolean]
-android:noHistory : Specify whether an activity should be kept in its history stack. [boolean]
-android:alwaysRetainTaskState : Specify whether an acitivty's task state should always be maintained by the system, or if it is allowed to reset the task to its initial state in certain situations. [boolean]
-android:stateNotNeeded : Indicates that an Activity does not need to have its freeze state (as returned by onSaveInstanceState retained in order to be restarted. [boolean]
-android:excludeFromRecents : Indicates that an Activity should be excluded from the list of recently launched activities. [boolean]
-android:enabled : Specify whether the activity is enabled or not (that is, can be instantiated by the system). [boolean]
-android:exported : Flag indicating whether the given application component is available to other applications. [boolean]
-android:windowSoftInputMode : Specify the default soft-input mode for the main window of this activity. [flag]
-android:immersive : Flag declaring this activity to be 'immersive'; immersive activities should not be interrupted with other activities or notifications. [boolean]
-android:hardwareAccelerated : <p>Flag indicating whether the application's rendering should be hardware accelerated if possible. [boolean]
-android:uiOptions : Extra options for an activity's UI. [flag]
-android:parentActivityName : The name of the logical parent of the activity as it appears in the manifest. [string]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
deleted file mode 100644
index cf7e0f4a1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Code completion in manifest.xml for <uses-sdk android:minSdkVersion="^11" />:
-17 : API 17: Android 4.2 (Jelly Bean)
-16 : API 16: Android 4.1 (Jelly Bean)
-15 : API 15: Android 4.0.3 (IceCreamSandwich)
-14 : API 14: Android 4.0 (IceCreamSandwich)
-13 : API 13: Android 3.2 (Honeycomb)
-12 : API 12: Android 3.1 (Honeycomb)
-11 : API 11: Android 3.0 (Honeycomb)
-10 : API 10: Android 2.3.3 (Gingerbread)
-9 : API 9: Android 2.3 (Gingerbread)
-8 : API 8: Android 2.2 (Froyo)
-7 : API 7: Android 2.1 (Eclair)
-6 : API 6: Android 2.0.1 (Eclair)
-5 : API 5: Android 2.0 (Eclair)
-4 : API 4: Android 1.6 (Donut)
-3 : API 3: Android 1.5 (Cupcake)
-2 : API 2: Android 1.1
-1 : API 1: Android 1.0
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt
deleted file mode 100644
index c745f54d3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Go To Declaration in manifest.xml for <uses-permission android:name="android.permission.AC^CESS_NETWORK_STATE" />:
-Open XML Declaration : [android.permission.ACCESS_NETWORK_STATE]
-
-
-After open, a browser is shown with this URL:
- reference/android/Manifest.permission.html#ACCESS_NETWORK_STATE
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt
deleted file mode 100644
index eaeddf9ef..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Go To Declaration in manifest.xml for <action android:name="android.intent.ac^tion.MAIN" />:
-Open XML Declaration : [android.intent.action.MAIN]
-
-
-After open, a browser is shown with this URL:
- reference/android/content/Intent.html#ACTION_MAIN
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt
deleted file mode 100644
index 9acb3308a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Go To Declaration in manifest.xml for <category android:name="android.intent.category.LA^UNCHER" />:
-Open XML Declaration : [android.intent.category.LAUNCHER]
-
-
-After open, a browser is shown with this URL:
- reference/android/content/Intent.html#CATEGORY_LAUNCHER
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt
deleted file mode 100644
index 2221e377c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Go To Declaration in manifest.xml for <activity android:name=".Test^Activity":
-Open XML Declaration : [.TestActivity]
-
-
-After open, the selected text is:
-^<?xml version="1.0" encoding="utf-8"?>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml
deleted file mode 100644
index 2c0024f04..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="foo.bar"
- android:versionCode="1"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="11" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".TestActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
-
- </application>
-</manifest>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml
deleted file mode 100644
index 9262f97cd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout android:id="@+id/LinearLayout1"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="match_parent">
- <ListView android:layout_width="match_parent" android:id="@+id/listView1"
- android:layout_height="wrap_content">
- </ListView>
- <Button android:text="Button" android:id="@+id/button1"/>
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt
deleted file mode 100644
index 6b9cf5b45..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-Code completion in navigation1.xml for ?android:a^ttr/alertDialogStyle:
-?android:attr/
-?android:allowClearUserData
-?android:authorities
-?android:action
-?android:alertDialogStyle
-?android:absListViewStyle
-?android:autoCompleteTextViewStyle
-?android:autoLink
-?android:activityOpenEnterAnimation
-?android:activityOpenExitAnimation
-?android:activityCloseEnterAnimation
-?android:activityCloseExitAnimation
-?android:animationCache
-?android:alwaysDrawnWithCache
-?android:addStatesFromChildren
-?android:animationDuration
-?android:antialias
-?android:adjustViewBounds
-?android:autoText
-?android:angle
-?android:animation
-?android:animationOrder
-?android:alphabeticShortcut
-?android:alwaysRetainTaskState
-?android:allowTaskReparenting
-?android:apiKey
-?android:allowSingleTap
-?android:animateOnClick
-?android:anyDensity
-?android:allowBackup
-?android:autoUrlDetect
-?android:accountType
-?android:accountPreferences
-?android:author
-?android:autoStart
-?android:allContactsName
-?android:actionBarStyle
-?android:animateFirstView
-?android:actionDropDownStyle
-?android:actionButtonStyle
-?android:actionModeBackground
-?android:actionModeCloseDrawable
-?android:actionBarSize
-?android:animateLayoutChanges
-?android:actionBarTabStyle
-?android:actionBarTabBarStyle
-?android:actionBarTabTextStyle
-?android:actionOverflowButtonStyle
-?android:actionModeCloseButtonStyle
-?android:actionLayout
-?android:actionViewClass
-?android:activatedBackgroundIndicator
-?android:alertDialogTheme
-?android:autoAdvanceViewId
-?android:actionModeCutDrawable
-?android:actionModeCopyDrawable
-?android:actionModePasteDrawable
-?android:animationResolution
-?android:alpha
-?android:allowParallelSyncs
-?android:alertDialogIcon
-?android:actionMenuTextAppearance
-?android:actionMenuTextColor
-?android:alignmentMode
-?android:actionModeSelectAllDrawable
-?android:accessibilityEventTypes
-?android:accessibilityFeedbackType
-?android:accessibilityFlags
-?android:actionBarSplitStyle
-?android:actionProviderClass
-?android:actionModeStyle
-?android:actionBarWidgetTheme
-?android:actionBarDivider
-?android:actionBarItemBackground
-?android:actionModeSplitBackground
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt
deleted file mode 100644
index 7308a4832..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigation1.xml for android:text="@string/app^_name":
-Open Declaration in values/strings.xml : [@string/app_name]
- L/PROJECTNAME/res/values/strings.xml
-
-
-After open, the selected text is:
- [^<string name="app_name">PROJECTNAME</string>]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt
deleted file mode 100644
index 23fa07e00..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Go To Declaration in navigation1.xml for <my.Cust^omView></my.CustomView>:
-Open XML Declaration : [my.CustomView]
-
-
-After open, the selected text is:
-^<?xml version="1.0" encoding="utf-8"?>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt
deleted file mode 100644
index e36c5f30b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigation1.xml for ?android:attr/alert^DialogStyle:
-Open Declaration in values/attrs.xml : [?android:attr/alertDialogStyle]
- data/res/values/attrs.xml
-
-
-After open, the selected text is:
- <attr name="alertDialogStyle" format="reference" />^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt
deleted file mode 100644
index b6f6cb2bc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigation1.xml for ?android:alert^DialogStyle:
-Open Declaration in values/attrs.xml : [?android:alertDialogStyle]
- data/res/values/attrs.xml
-
-
-After open, the selected text is:
- <attr name="alertDialogStyle" format="reference" />^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt
deleted file mode 100644
index f91e1f9ae..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigation1.xml for marginLeft="@android:dimen/app_ico^n_size":
-Open Declaration in values/dimens.xml : [@android:dimen/app_icon_size]
- data/res/values/dimens.xml
-
-
-After open, the selected text is:
- <dimen name="app_icon_size">^48dip</dimen>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt
deleted file mode 100644
index 53776a062..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigation1.xml for style="@android:style/Widget.B^utton":
-Open Declaration in values/styles.xml : [@android:style/Widget.Button]
- data/res/values/styles.xml
-
-
-After open, the selected text is:
- <style name="Widget.Button">^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt
deleted file mode 100644
index ec5ee3801..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-Go To Declaration in navigation1.xml for android:text="@android:st^ring/ok":
-Open Declaration in values-en-rGB/strings.xml : [@android:string/ok]
- data/res/values-en-rGB/strings.xml
-Open Declaration in values/strings.xml : [@android:string/ok]
- data/res/values/strings.xml
-Open Declaration in values-ar/strings.xml : [@android:string/ok]
- data/res/values-ar/strings.xml
-Open Declaration in values-bg/strings.xml : [@android:string/ok]
- data/res/values-bg/strings.xml
-Open Declaration in values-ca/strings.xml : [@android:string/ok]
- data/res/values-ca/strings.xml
-Open Declaration in values-cs/strings.xml : [@android:string/ok]
- data/res/values-cs/strings.xml
-Open Declaration in values-da/strings.xml : [@android:string/ok]
- data/res/values-da/strings.xml
-Open Declaration in values-de/strings.xml : [@android:string/ok]
- data/res/values-de/strings.xml
-Open Declaration in values-el/strings.xml : [@android:string/ok]
- data/res/values-el/strings.xml
-Open Declaration in values-es/strings.xml : [@android:string/ok]
- data/res/values-es/strings.xml
-Open Declaration in values-es-rUS/strings.xml : [@android:string/ok]
- data/res/values-es-rUS/strings.xml
-Open Declaration in values-fa/strings.xml : [@android:string/ok]
- data/res/values-fa/strings.xml
-Open Declaration in values-fi/strings.xml : [@android:string/ok]
- data/res/values-fi/strings.xml
-Open Declaration in values-fr/strings.xml : [@android:string/ok]
- data/res/values-fr/strings.xml
-Open Declaration in values-hr/strings.xml : [@android:string/ok]
- data/res/values-hr/strings.xml
-Open Declaration in values-hu/strings.xml : [@android:string/ok]
- data/res/values-hu/strings.xml
-Open Declaration in values-in/strings.xml : [@android:string/ok]
- data/res/values-in/strings.xml
-Open Declaration in values-it/strings.xml : [@android:string/ok]
- data/res/values-it/strings.xml
-Open Declaration in values-iw/strings.xml : [@android:string/ok]
- data/res/values-iw/strings.xml
-Open Declaration in values-ja/strings.xml : [@android:string/ok]
- data/res/values-ja/strings.xml
-Open Declaration in values-ko/strings.xml : [@android:string/ok]
- data/res/values-ko/strings.xml
-Open Declaration in values-lt/strings.xml : [@android:string/ok]
- data/res/values-lt/strings.xml
-Open Declaration in values-lv/strings.xml : [@android:string/ok]
- data/res/values-lv/strings.xml
-Open Declaration in values-nb/strings.xml : [@android:string/ok]
- data/res/values-nb/strings.xml
-Open Declaration in values-nl/strings.xml : [@android:string/ok]
- data/res/values-nl/strings.xml
-Open Declaration in values-pl/strings.xml : [@android:string/ok]
- data/res/values-pl/strings.xml
-Open Declaration in values-pt/strings.xml : [@android:string/ok]
- data/res/values-pt/strings.xml
-Open Declaration in values-pt-rPT/strings.xml : [@android:string/ok]
- data/res/values-pt-rPT/strings.xml
-Open Declaration in values-rm/strings.xml : [@android:string/ok]
- data/res/values-rm/strings.xml
-Open Declaration in values-ro/strings.xml : [@android:string/ok]
- data/res/values-ro/strings.xml
-Open Declaration in values-ru/strings.xml : [@android:string/ok]
- data/res/values-ru/strings.xml
-Open Declaration in values-sk/strings.xml : [@android:string/ok]
- data/res/values-sk/strings.xml
-Open Declaration in values-sl/strings.xml : [@android:string/ok]
- data/res/values-sl/strings.xml
-Open Declaration in values-sr/strings.xml : [@android:string/ok]
- data/res/values-sr/strings.xml
-Open Declaration in values-sv/strings.xml : [@android:string/ok]
- data/res/values-sv/strings.xml
-Open Declaration in values-th/strings.xml : [@android:string/ok]
- data/res/values-th/strings.xml
-Open Declaration in values-tl/strings.xml : [@android:string/ok]
- data/res/values-tl/strings.xml
-Open Declaration in values-tr/strings.xml : [@android:string/ok]
- data/res/values-tr/strings.xml
-Open Declaration in values-uk/strings.xml : [@android:string/ok]
- data/res/values-uk/strings.xml
-Open Declaration in values-vi/strings.xml : [@android:string/ok]
- data/res/values-vi/strings.xml
-Open Declaration in values-zh-rCN/strings.xml : [@android:string/ok]
- data/res/values-zh-rCN/strings.xml
-Open Declaration in values-zh-rTW/strings.xml : [@android:string/ok]
- data/res/values-zh-rTW/strings.xml
-
-
-After open, the selected text is:
- <string name="ok" msgid="5970060430562524910">^"OK"</string>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
deleted file mode 100644
index c5b292e7b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <Button
- android:text="@string/app_name"
- android:layout_marginLeft="@android:dimen/app_icon_size"
- style="@android:style/Widget.Button"
- android:id="@+id/button1"
- ></Button>
- <my.CustomView></my.CustomView>
- <EditText
- android:text="@android:string/ok"
- </EditText>
- <EditText android:text="?android:attr/alertDialogStyle" />
- <EditText android:text="?android:alertDialogStyle" />
-</LinearLayout>
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
deleted file mode 100644
index 8890f79ea..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
+++ /dev/null
@@ -1,5 +0,0 @@
-@@ -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/navigationstyles-expected-navigate5.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt
deleted file mode 100644
index 15c91d1be..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigationstyles.xml for parent="android:Theme.Li^ght">:
-Open Declaration in values/themes.xml : [android:Theme.Light]
- data/res/values/themes.xml
-
-
-After open, the selected text is:
- <style name="Theme.Light">^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt
deleted file mode 100644
index 5a4f40aa4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigationstyles.xml for parent="android:The^me.Light">:
-Open Declaration in values/themes.xml : [android:Theme]
- data/res/values/themes.xml
-
-
-After open, the selected text is:
- <style name="Theme">^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt
deleted file mode 100644
index 8f7eb46b8..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigationstyles.xml for popupBackground">@android:drawable/spinner_dr^opdown_background</item>:
-Open Declaration in drawable/spinner_dropdown_background.xml : [@android:drawable/spinner_dropdown_background]
- data/res/drawable/spinner_dropdown_background.xml
-
-
-After open, the selected text is:
-^<?xml version="1.0" encoding="utf-8"?>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt
deleted file mode 100644
index b74c67681..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Go To Declaration in navigationstyles.xml for colorBackground"> @color/cust^om_theme_color </item>:
-Open Declaration in values/navigationstyles.xml : [@color/custom_theme_color]
- L/PROJECTNAME/res/values/navigationstyles.xml
-
-
-After open, the selected text is:
- [^<color name="custom_theme_color">#b0b0ff</color>]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml
deleted file mode 100644
index da4bbf289..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <color name="custom_theme_color">#b0b0ff</color>
- <style name="CustomTheme" parent="android:Theme.Light">
- <item name="android:windowBackground">@color/custom_theme_color</item>
- <item name="android:colorBackground"> @color/custom_theme_color </item>
- </style>
-
- <style name="BrowserTheme" parent="@android:Theme.Black">
- <item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextView</item>
- <item name="android:windowNoTitle">true</item>
- </style>
-
- <style name="AutoCompleteTextView">
- <item name="android:focusable">true</item>
- <item name="android:focusableInTouchMode">true</item>
- <item name="android:clickable">true</item>
- <item name="android:completionHintView">@android:layout/simple_dropdown_item_1line</item>
- <item name="android:textAppearance">?android:attr/textAppearanceLargeInverse</item>
- <item name="android:completionThreshold">2</item>
- <item name="android:dropDownSelector">@android:drawable/list_selector_background</item>
- <item name="android:popupBackground">@android:drawable/spinner_dropdown_background</item>
- </style>
-
- <style name="CustomTitle" parent="@android:Theme">
- <item name="android:windowTitleSize">60dip</item>
- </style>
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml
deleted file mode 100644
index 2a0e9477c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Button xmlns:android="http://schemas.android.com/apk/res/android" android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml
deleted file mode 100644
index b2d1789aa..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-</merge>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml
deleted file mode 100644
index 6ba61c838..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Button xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:id="@+id/button3" android:layout_height="wrap_content" 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/newlayout3-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml
deleted file mode 100644
index ee8568e68..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml
deleted file mode 100644
index be5706645..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-</merge>
-
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
deleted file mode 100644
index 6772a8fa2..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-@@ -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
deleted file mode 100644
index d0fdc92e5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
+++ /dev/null
@@ -1,29 +0,0 @@
-@@ -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
deleted file mode 100644
index 0949fbd01..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index 0949fbd01..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index 0949fbd01..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index e8b553ec9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index 0949fbd01..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index 88a94e7e0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index 49043b93c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
+++ /dev/null
@@ -1,9 +0,0 @@
-@@ -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
deleted file mode 100644
index 49ab2c3ee..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
+++ /dev/null
@@ -1,9 +0,0 @@
-@@ -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/newstyles7-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff
deleted file mode 100644
index 51f0812c9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
-> <style name="newstyle">
-> <item name="android:layout_alignParentBottom">true</item>
-> <item name="android:layout_height">wrap_content</item>
-> <item name="android:layout_width">wrap_content</item>
-> <item name="android:text">Button</item>
-> <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/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
deleted file mode 100644
index 6bcd6ffd4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index a51abf407..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="app_name">PROJECTNAME</string>
- <string name="firststring">[^TODO]</string>
-
-</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-quickFix2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml
deleted file mode 100644
index a0d04fb6e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <dimen name="testdimen">[^1dp]</dimen>
-</resources>
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
deleted file mode 100644
index 900c42064..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- ^
-
-</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/quickfix1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml
deleted file mode 100644
index 927c8d1db..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <Button android:text="@string/firststring"
- android:id="@+id/button1"
- android:layout_width="@dimen/testdimen"
- android:layout_height="wrap_content">
- </Button>
-
- <include layout="@layout/testlayout" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-
-</LinearLayout>
-
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
deleted file mode 100644
index 7b638c645..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-@@ -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/quickfix2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml
deleted file mode 100644
index 4f2a925a5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
- <!--
- Random comment here
- -->
-<color android:color="#0000000"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml
deleted file mode 100644
index e72638f57..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableTop="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
-</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/refactoring/usecompound/compound1.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info
deleted file mode 100644
index 4f0aea55e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info
+++ /dev/null
@@ -1,4 +0,0 @@
-android.widget.LinearLayout [0,121,800,480] <LinearLayout>
- android.widget.LinearLayout [0,0,109,97] <LinearLayout>
- android.widget.ImageView [18,0,90,72] <ImageView>
- android.widget.TextView [0,72,109,97] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml
deleted file mode 100644
index e4f5bf20e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/layout1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml
deleted file mode 100644
index 2b9d338d1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableBottom="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
-</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/refactoring/usecompound/compound2.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info
deleted file mode 100644
index 37084fb88..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info
+++ /dev/null
@@ -1,5 +0,0 @@
-android.widget.LinearLayout [0,121,800,480] <LinearLayout>
- android.widget.LinearLayout [0,0,109,97] <LinearLayout>
- android.widget.TextView [0,0,109,25] <TextView>
- android.widget.ImageView [18,25,90,97] <ImageView>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml
deleted file mode 100644
index c24fb211c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/layout2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml
deleted file mode 100644
index ac8ffa8ce..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
-</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/refactoring/usecompound/compound3.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info
deleted file mode 100644
index 01d1127f1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info
+++ /dev/null
@@ -1,4 +0,0 @@
-android.widget.LinearLayout [0,121,800,480] <LinearLayout>
- android.widget.LinearLayout [0,0,181,72] <LinearLayout>
- android.widget.ImageView [0,0,72,72] <ImageView>
- android.widget.TextView [72,23,181,48] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml
deleted file mode 100644
index 2444e4830..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/layout3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml
deleted file mode 100644
index af9b1c922..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableRight="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
-</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/refactoring/usecompound/compound4.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info
deleted file mode 100644
index 4b39be81e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info
+++ /dev/null
@@ -1,4 +0,0 @@
-android.widget.LinearLayout [0,121,800,480] <LinearLayout>
- android.widget.LinearLayout [0,0,181,72] <LinearLayout>
- android.widget.TextView [0,23,109,48] <TextView>
- android.widget.ImageView [109,0,181,72] <ImageView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml
deleted file mode 100644
index 2f6afd2f7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/layout4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml
deleted file mode 100644
index e909811cf..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableBottom="@drawable/ic_launcher"
- android:text="Hello World" >
-
-</TextView> \ 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/refactoring/usecompound/compound5.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info
deleted file mode 100644
index 8eb5c4b86..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info
+++ /dev/null
@@ -1,3 +0,0 @@
-android.widget.LinearLayout [0,74,480,800] <LinearLayout>
- android.widget.TextView [0,0,107,26] <TextView>
- android.widget.ImageView [0,26,72,98] <ImageView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml
deleted file mode 100644
index 49c0594da..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:id="@+id/layout"
- android:orientation="vertical" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml
deleted file mode 100644
index 1ef5d78c6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/ic_launcher"
- android:drawablePadding="@android:dimen/thumbnail_width"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
-</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/refactoring/usecompound/compound6.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info
deleted file mode 100644
index 4f0aea55e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info
+++ /dev/null
@@ -1,4 +0,0 @@
-android.widget.LinearLayout [0,121,800,480] <LinearLayout>
- android.widget.LinearLayout [0,0,109,97] <LinearLayout>
- android.widget.ImageView [18,0,90,72] <ImageView>
- android.widget.TextView [0,72,109,97] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml
deleted file mode 100644
index 94a363ba5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/layout1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="@android:dimen/thumbnail_width"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml
deleted file mode 100644
index 1b2a8643e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawablePadding="35dp"
- android:drawableTop="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
-</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/refactoring/usecompound/compound7.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info
deleted file mode 100644
index 4f0aea55e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info
+++ /dev/null
@@ -1,4 +0,0 @@
-android.widget.LinearLayout [0,121,800,480] <LinearLayout>
- android.widget.LinearLayout [0,0,109,97] <LinearLayout>
- android.widget.ImageView [18,0,90,72] <ImageView>
- android.widget.TextView [0,72,109,97] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml
deleted file mode 100644
index 46393fe0e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:id="@+id/layout1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dp"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="25dp"
- android:text="Hello World" />
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml
deleted file mode 100644
index 35bebf5f1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <LinearLayout
- android:id="@+id/layout1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout1"
- android:drawableBottom="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
- <LinearLayout
- android:id="@+id/layout3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/textView2"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/layout4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout3"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
-</RelativeLayout> \ 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/refactoring/usecompound/compound_all-expected-6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml
deleted file mode 100644
index 6d9925674..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <LinearLayout
- android:id="@+id/layout1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/layout2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout1"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
- <TextView
- android:id="@+id/TextView1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout2"
- android:drawableLeft="@drawable/ic_launcher"
- android:gravity="center"
- android:text="Hello World" >
- </TextView>
-
- <LinearLayout
- android:id="@+id/layout4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/TextView1"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
-</RelativeLayout> \ 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/refactoring/usecompound/compound_all.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info
deleted file mode 100644
index 57508bd72..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info
+++ /dev/null
@@ -1,13 +0,0 @@
-android.widget.RelativeLayout [0,121,800,480] <RelativeLayout>
- android.widget.LinearLayout [0,0,109,97] <LinearLayout>
- android.widget.ImageView [18,0,90,72] <ImageView>
- android.widget.TextView [0,72,109,97] <TextView>
- android.widget.LinearLayout [0,97,109,194] <LinearLayout>
- android.widget.TextView [0,0,109,25] <TextView>
- android.widget.ImageView [18,25,90,97] <ImageView>
- android.widget.LinearLayout [0,194,181,266] <LinearLayout>
- android.widget.ImageView [0,0,72,72] <ImageView>
- android.widget.TextView [72,23,181,48] <TextView>
- android.widget.LinearLayout [0,266,181,338] <LinearLayout>
- android.widget.TextView [0,23,109,48] <TextView>
- android.widget.ImageView [109,0,181,72] <ImageView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml
deleted file mode 100644
index 0406b171d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
-
- <LinearLayout
- android:id="@+id/layout1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:orientation="vertical" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/layout2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout1"
- android:gravity="center"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/layout3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout2"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/layout4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/layout3"
- android:gravity="center"
- android:orientation="horizontal" >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ic_launcher" />
- </LinearLayout>
-
-</RelativeLayout>
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
deleted file mode 100644
index 98e1f36f4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/LinearLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="2"
- android:orientation="horizontal" >
-
- <Button
- android:id="@+id/button1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
-
- <RadioButton
- 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
- android:id="@+id/radioButton2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="RadioButton" />
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="CheckBox" />
-
-</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/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
deleted file mode 100644
index aa8ecdac2..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/LinearLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="2"
- android:orientation="vertical" >
-
- <Button
- android:id="@+id/button1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" />
-
- <RadioButton
- 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
- android:id="@+id/radioButton2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="RadioButton" />
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="CheckBox" />
-
-</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/sample10.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info
deleted file mode 100644
index c964b0eba..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info
+++ /dev/null
@@ -1,5 +0,0 @@
-android.widget.GridLayout [0,73,320,480] <GridLayout>
- android.widget.Button [0,0,79,48] <Button>
- android.widget.RadioButton [0,48,150,86] <RadioButton>
- android.widget.RadioButton [150,48,273,86] <RadioButton>
- android.widget.CheckBox [0,86,107,124] <CheckBox>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml
deleted file mode 100644
index 1fcaab569..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/GridLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="2"
- android:orientation="horizontal" >
-
- <Button
- android:id="@+id/button1"
- android:text="Button" />
-
- <RadioButton
- android:id="@+id/radioButton1"
- android:layout_width="150dp"
- android:layout_column="0"
- android:layout_row="1"
- android:text="RadioButton" />
-
- <RadioButton
- android:id="@+id/radioButton2"
- android:text="RadioButton" />
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:text="CheckBox" />
-
-</GridLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml
deleted file mode 100644
index d10626a90..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2010 Google Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/home_root"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:columnCount="3"
- android:orientation="horizontal" >
-
- <Button
- android:layout_gravity="fill_horizontal"
- android:layout_weight="1" />
-
- <Button
- android:layout_gravity="fill_horizontal"
- android:layout_weight="1" />
-
- <Button
- android:layout_column="0"
- android:layout_gravity="fill_horizontal"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
-
- <Button
- android:layout_gravity="fill_horizontal"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
-
- <Button
- android:layout_column="0"
- android:layout_gravity="fill_horizontal"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
-
- <Button
- android:layout_gravity="fill_horizontal"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
-
- <Space
- android:layout_column="2"
- android:layout_gravity="fill_vertical"
- android:layout_row="3" />
-
-</GridLayout> \ 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/sample11.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info
deleted file mode 100644
index 560e8a877..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info
+++ /dev/null
@@ -1,11 +0,0 @@
-android.widget.LinearLayout [0,50,480,320] <LinearLayout>
- android.widget.LinearLayout [0,0,480,270] <LinearLayout>
- android.widget.LinearLayout [6,6,474,92] <LinearLayout>
- android.widget.Button [0,19,234,67] <Button>
- android.widget.Button [234,19,468,67] <Button>
- android.widget.LinearLayout [6,92,474,178] <LinearLayout>
- android.widget.Button [0,19,234,67] <Button>
- android.widget.Button [234,19,468,67] <Button>
- android.widget.LinearLayout [6,178,474,264] <LinearLayout>
- android.widget.Button [0,19,234,67] <Button>
- android.widget.Button [234,19,468,67] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml
deleted file mode 100644
index 4df91a190..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2010 Google Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/home_root"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:padding="6dip" >
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="horizontal" >
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1" />
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="horizontal" >
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="horizontal" >
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
-
- <Button
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:gravity="center_horizontal" />
- </LinearLayout>
- </LinearLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt
deleted file mode 100644
index 8eccdfc52..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Quick assistant in sample1a.xml for <Button android:text="Fir^stButton":
-Extract Android String : Initiates the "Extract Android String" refactoring
-Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt
deleted file mode 100644
index b435ef49c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Quick assistant in sample1a.xml for <Bu^tton android:text:
-Wrap in Container : Initiates the "Wrap in Container" refactoring
-Remove Container : Initiates the "Remove Container" refactoring
-Change Widget Type : Initiates the "Change Widget Type" refactoring
-Change Layout : Initiates the "Change Layout" refactoring
-Extract as Include : Initiates the "Extract as Include" refactoring
-Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt
deleted file mode 100644
index a7c46c026..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Quick assistant in sample1a.xml for <Button andr^oid:text="FirstButton":
-Wrap in Container : Initiates the "Wrap in Container" refactoring
-Remove Container : Initiates the "Remove Container" refactoring
-Change Widget Type : Initiates the "Change Widget Type" refactoring
-Change Layout : Initiates the "Change Layout" refactoring
-Extract as Include : Initiates the "Extract as Include" refactoring
-Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
deleted file mode 100644
index 30bb00b25..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Quick assistant in sample1a.xml for android:id="@+id/Linea^rLayout2":
-Rename Android Resource : Initiates the "Rename Android Resource" refactoring
-Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml
deleted file mode 100644
index d03c92535..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- 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:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:text="FirstButton" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button1"
- android:layout_marginTop="2dp"
- android:text="SecondButton" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button2"
- android:layout_alignTop="@+id/button2"
- android:layout_toRightOf="@+id/button2"
- android:text="ThirdButton" >
- </Button>
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button2"
- android:layout_below="@+id/button1"
- android:layout_toRightOf="@+id/button3"
- android:text="CheckBox" >
- </CheckBox>
-
- <Button
- android:id="@+id/button4"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/checkBox1"
- android:text="FourthButton" >
- </Button>
-
- <Button
- android:id="@+id/button5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button4"
- android:layout_gravity="right"
- android:text="FifthButton" >
- </Button>
-
- <Button
- android:id="@+id/button6"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button5"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/sample1a-expected-changeView1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml
deleted file mode 100644
index f4a08d023..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<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">
- <RadioButton android:text="FirstButton" android:id="@+id/RadioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
- <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">
- <RadioButton android:text="Button" android:id="@+id/RadioButton2" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
-</LinearLayout>
-
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
deleted file mode 100644
index 1ae5748e4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
+++ /dev/null
@@ -1,9 +0,0 @@
-@@ -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
deleted file mode 100644
index 6d18aab26..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
+++ /dev/null
@@ -1,84 +0,0 @@
-@@ -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/sample1a-expected-gridLayout1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml
deleted file mode 100644
index 72fe214ce..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/GridLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="4"
- android:orientation="horizontal" >
-
- <Button
- android:id="@+id/button1"
- android:layout_gravity="left"
- android:text="FirstButton" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_column="0"
- android:layout_gravity="left"
- android:text="SecondButton" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_gravity="left"
- android:text="ThirdButton" >
- </Button>
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_gravity="left"
- android:text="CheckBox" >
- </CheckBox>
-
- <Button
- android:id="@+id/button4"
- android:layout_column="0"
- android:layout_columnSpan="3"
- android:layout_gravity="fill_horizontal"
- android:text="FourthButton" >
- </Button>
-
- <Button
- android:id="@+id/button5"
- android:layout_column="0"
- android:layout_gravity="right"
- android:text="FifthButton" >
- </Button>
-
- <Button
- android:id="@+id/button6"
- android:layout_column="0"
- android:layout_gravity="left"
- android:text="Button" >
- </Button>
-
- <Space
- android:layout_column="3"
- android:layout_gravity="fill_vertical"
- android:layout_row="5" />
-
-</GridLayout> \ 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/sample1a.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info
deleted file mode 100644
index 20a23b08d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info
+++ /dev/null
@@ -1,13 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.Button [0,0,70,36] <Button>
- android.widget.LinearLayout [0,36,240,72] <LinearLayout>
- android.widget.Button [0,2,84,38] <Button>
- android.widget.Button [84,2,158,38] <Button>
- android.widget.CheckBox [158,0,238,36] <CheckBox>
- android.widget.Button [0,72,240,108] <Button>
- android.widget.LinearLayout [0,108,240,144] <LinearLayout>
- android.widget.Button [0,0,71,36] <Button>
- android.widget.LinearLayout [0,144,240,180] <LinearLayout>
- android.widget.LinearLayout [0,0,49,36] <LinearLayout>
- android.widget.LinearLayout [0,0,49,36] <LinearLayout>
- android.widget.Button [0,0,49,36] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml
deleted file mode 100644
index 9a9493592..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<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>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml
deleted file mode 100644
index d03c92535..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- 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:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:text="FirstButton" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button1"
- android:layout_marginTop="2dp"
- android:text="SecondButton" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button2"
- android:layout_alignTop="@+id/button2"
- android:layout_toRightOf="@+id/button2"
- android:text="ThirdButton" >
- </Button>
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button2"
- android:layout_below="@+id/button1"
- android:layout_toRightOf="@+id/button3"
- android:text="CheckBox" >
- </CheckBox>
-
- <Button
- android:id="@+id/button4"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/checkBox1"
- android:text="FourthButton" >
- </Button>
-
- <Button
- android:id="@+id/button5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button4"
- android:layout_gravity="right"
- android:text="FifthButton" >
- </Button>
-
- <Button
- android:id="@+id/button6"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button5"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/sample1b.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info
deleted file mode 100644
index 7807227c3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info
+++ /dev/null
@@ -1,14 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.Button [0,0,70,36] <Button>
- android.widget.LinearLayout [0,36,240,72] <LinearLayout>
- android.widget.Button [0,2,84,38] <Button>
- android.widget.Button [84,2,158,38] <Button>
- android.widget.CheckBox [158,0,238,36] <CheckBox>
- android.widget.Button [0,72,240,108] <Button>
- android.widget.LinearLayout [0,108,240,144] <LinearLayout>
- android.widget.Button [0,0,71,36] <Button>
- android.widget.LinearLayout [0,144,240,180] <LinearLayout>
- android.widget.LinearLayout [0,0,49,36] <LinearLayout>
- android.widget.LinearLayout [0,0,49,36] <LinearLayout>
- android.widget.Button [0,0,49,36] <Button>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml
deleted file mode 100644
index 6b800ae77..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<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>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml
deleted file mode 100644
index 06420c483..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- 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:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button1"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/button2"
- android:layout_toRightOf="@+id/button2"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/button3"
- android:layout_toRightOf="@+id/button3"
- android:text="Button" >
- </Button>
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/button4"
- android:layout_toLeftOf="@+id/button4"
- android:text="CheckBox" >
- </CheckBox>
-
- <Button
- android:id="@+id/button5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignTop="@+id/button2"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/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
deleted file mode 100644
index 366c8df70..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout 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="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: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: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/sample2-expected-extract3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml
deleted file mode 100644
index e4ff73166..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout 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="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>
- <include layout="@layout/newlayout3" android:id="@+id/button3_ref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/button2" android:layout_toRightOf="@+id/button2"/>
- <Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/button3_ref" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button3_ref"></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>
- <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/button5" android:layout_alignParentRight="true"></Button>
- </RelativeLayout>
-</LinearLayout>
-
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml
deleted file mode 100644
index 8b9056216..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/GridLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="6"
- android:orientation="horizontal" >
-
- <Button
- android:id="@+id/button1"
- android:layout_columnSpan="2"
- android:layout_gravity="left"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_alignParentLeft="true"
- android:layout_column="0"
- android:layout_columnSpan="2"
- android:layout_gravity="left"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_below="@+id/button2"
- android:layout_gravity="left"
- android:layout_row="2"
- android:layout_toRightOf="@+id/button2"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button4"
- android:layout_below="@+id/button3"
- android:layout_gravity="left"
- android:layout_row="3"
- android:layout_toRightOf="@+id/button3"
- android:text="Button" >
- </Button>
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_below="@+id/button4"
- android:layout_column="1"
- android:layout_columnSpan="2"
- android:layout_gravity="left"
- android:layout_toLeftOf="@+id/button4"
- android:text="CheckBox" >
- </CheckBox>
-
- <Button
- android:id="@+id/button5"
- android:layout_alignParentRight="true"
- android:layout_column="4"
- android:layout_gravity="left"
- android:layout_row="1"
- android:text="Button" >
- </Button>
-
- <Space
- android:layout_column="5"
- android:layout_gravity="fill_vertical"
- android:layout_row="5" />
-
-</GridLayout> \ 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/sample2.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info
deleted file mode 100644
index 44d3b626d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info
+++ /dev/null
@@ -1,9 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.Button [0,0,49,36] <Button>
- android.widget.RelativeLayout [0,36,240,284] <RelativeLayout>
- android.widget.Button [0,0,49,36] <Button>
- android.widget.Button [49,36,98,72] <Button>
- android.widget.Button [98,72,147,108] <Button>
- android.widget.CheckBox [18,108,98,144] <CheckBox>
- android.widget.Button [191,0,240,36] <Button>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml
deleted file mode 100644
index 0697c645c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout 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="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>
- <Button android:layout_width="wrap_content" android:id="@+id/button3" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button2"></Button>
- <Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/button3" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button3"></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>
- <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/button5" android:layout_alignParentRight="true"></Button>
- </RelativeLayout>
-</LinearLayout>
-
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml
deleted file mode 100644
index 268688b83..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/newlinear"
- 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:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:text="Button" >
- </Button>
-
- <ImageView
- android:id="@+id/android_logo"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_above="@+id/button2"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button1"
- android:layout_weight="1.0"
- android:clickable="false"
- android:focusable="false"
- android:src="@drawable/android_button" />
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/sample3-expected-extract1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml
deleted file mode 100644
index 70f576ed6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
- <include layout="@layout/newlayout1" android:id="@+id/button2_ref" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml
deleted file mode 100644
index 9a30a96b5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <include layout="@layout/newlayout2" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml
deleted file mode 100644
index 445f88ac0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <include layout="@layout/newlayout3" android:id="@+id/android_logo_ref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0"/>
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml
deleted file mode 100644
index 8df41ca2e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <include layout="@layout/newlayout3" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml
deleted file mode 100644
index 097f87046..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/newlinear"
- 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="Button" >
- </Button>
-
- <ImageView
- android:id="@+id/android_logo"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1.0"
- android:clickable="false"
- android:focusable="false"
- android:src="@drawable/android_button" />
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" >
- </Button>
- </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/sample3-expected-wrapIn2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml
deleted file mode 100644
index 2921e40e7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<android.gesture.GestureOverlayView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <LinearLayout
- android:id="@+id/newlinear"
- 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="Button" >
- </Button>
-
- <ImageView
- android:id="@+id/android_logo"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1.0"
- android:clickable="false"
- android:focusable="false"
- android:src="@drawable/android_button" />
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" >
- </Button>
- </LinearLayout>
-
-</android.gesture.GestureOverlayView> \ 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/sample3-expected-wrapIn3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml
deleted file mode 100644
index 6b57216a6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/newlinear"
- 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="Button" >
- </Button>
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" >
-
- <ImageView
- android:id="@+id/android_logo"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1.0"
- android:clickable="false"
- android:focusable="false"
- android:src="@drawable/android_button" />
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Button" >
- </Button>
- </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/sample3-variation1-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml
deleted file mode 100644
index d616269ab..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <LinearLayout android:id="@+id/newlinear2" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <include layout="@layout/newlayout3" android:id="@+id/android_logo_ref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0"/>
- </LinearLayout>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml
deleted file mode 100644
index b37e7bebb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <LinearLayout android:id="@+id/newlinear2" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <include layout="@layout/newlayout3" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
- </LinearLayout>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml
deleted file mode 100644
index 9cf3c434a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <LinearLayout android:id="@+id/newlinear2" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button"
- android:focusable="false" android:clickable="false" android:layout_weight="1.0" android:id="@+id/android_logo" />
- </LinearLayout>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml
deleted file mode 100644
index 40676abd1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:customprefix="http://schemas.android.com/apk/res/android" customprefix:id="@+id/newlinear" customprefix:orientation="vertical" customprefix:layout_width="match_parent" customprefix:layout_height="match_parent">
- <include layout="@layout/newlayout3" customprefix:id="@+id/android_logo_ref" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content" customprefix:layout_weight="1.0"/>
- <Button customprefix:text="Button" customprefix:id="@+id/button1" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
- <Button customprefix:text="Button" customprefix:id="@+id/button2" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml
deleted file mode 100644
index c51dc3797..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:customprefix="http://schemas.android.com/apk/res/android" customprefix:id="@+id/newlinear" customprefix:orientation="vertical" customprefix:layout_width="match_parent" customprefix:layout_height="match_parent">
- <include layout="@layout/newlayout3" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"/>
- <Button customprefix:text="Button" customprefix:id="@+id/button2" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml
deleted file mode 100644
index 48d479024..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:customprefix="http://schemas.android.com/apk/res/android" customprefix:id="@+id/newlinear" customprefix:orientation="vertical" customprefix:layout_width="match_parent" customprefix:layout_height="match_parent">
- <ImageView customprefix:id="@+id/android_logo" customprefix:layout_width="wrap_content"
- customprefix:layout_height="wrap_content" customprefix:src="@drawable/android_button" customprefix:focusable="false" customprefix:clickable="false" customprefix:layout_weight="1.0" />
- <Button customprefix:text="Button" customprefix:id="@+id/button1" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
- <Button customprefix:text="Button" customprefix:id="@+id/button2" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info
deleted file mode 100644
index ef3324eb4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info
+++ /dev/null
@@ -1,5 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.Button [0,0,49,36] <Button>
- android.widget.ImageView [0,36,128,248] <ImageView>
- android.widget.Button [0,248,49,284] <Button>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml
deleted file mode 100644
index ddd136ce8..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml
deleted file mode 100644
index 6e5552950..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:text="CheckBox" >
- </CheckBox>
-
- <Button
- android:id="@+id/button5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/checkBox1"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/sample4.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info
deleted file mode 100644
index 605c17793..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info
+++ /dev/null
@@ -1,5 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.CheckBox [0,0,80,36] <CheckBox>
- android.widget.RelativeLayout [0,36,240,284] <RelativeLayout>
- android.widget.Button [191,0,240,36] <Button>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml
deleted file mode 100644
index a56f27294..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
- <CheckBox android:text="CheckBox" android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
- <RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
- <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/button5" android:layout_alignParentRight="true"></Button>
- </RelativeLayout>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml
deleted file mode 100644
index 06b236dfb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- 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:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_gravity="center_horizontal"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/button1"
- android:layout_centerHorizontal="true"
- android:layout_gravity="center"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_below="@+id/button2"
- android:layout_gravity="right"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@+id/button3"
- android:layout_gravity="center"
- android:layout_marginTop="70dp"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button5"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button4"
- android:layout_alignTop="@+id/button4"
- android:layout_gravity="center_vertical"
- android:layout_toRightOf="@+id/button4"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button6"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_gravity="bottom"
- android:layout_toRightOf="@+id/button5"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/sample5-expected-gridLayout5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml
deleted file mode 100644
index dd9f18cf2..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/GridLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="4"
- android:orientation="horizontal" >
-
- <Button
- android:id="@+id/button1"
- android:layout_columnSpan="2"
- android:layout_gravity="center_horizontal"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button2"
- android:layout_columnSpan="2"
- android:layout_gravity="center"
- android:layout_row="1"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button3"
- android:layout_column="2"
- android:layout_columnSpan="2"
- android:layout_gravity="right"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button4"
- android:layout_gravity="center"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button5"
- android:layout_columnSpan="2"
- android:layout_gravity="center_vertical"
- android:text="Button" >
- </Button>
-
- <Button
- android:id="@+id/button6"
- android:layout_gravity="bottom"
- android:text="Button" >
- </Button>
-
-</GridLayout> \ 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/sample5.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info
deleted file mode 100644
index fce532ecd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info
+++ /dev/null
@@ -1,9 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.Button [95,0,144,36] <Button>
- android.widget.Button [95,36,144,72] <Button>
- android.widget.Button [191,72,240,108] <Button>
- android.widget.LinearLayout [0,108,240,284] <LinearLayout>
- android.widget.Button [0,70,49,106] <Button>
- android.widget.Button [49,70,98,106] <Button>
- android.widget.Button [98,140,147,176] <Button>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml
deleted file mode 100644
index afc19388d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout 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="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal"></Button>
- <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"></Button>
- <Button android:text="Button" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right"></Button>
- <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent">
- <Button android:layout_height="wrap_content" android:layout_gravity="center" android:text="Button" android:id="@+id/button4" android:layout_width="wrap_content"></Button>
- <Button android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="Button" android:id="@+id/button5" android:layout_width="wrap_content"></Button>
- <Button android:layout_height="wrap_content" android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_gravity="bottom"></Button>
- </LinearLayout>
-</LinearLayout>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml
deleted file mode 100644
index a91ad1e7b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/RelativeLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:baselineAligned="true" >
-
- <Button
- android:id="@+id/button1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button2"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:text="Button" >
- </Button>
-
- <RadioButton
- android:id="@+id/radioButton1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/button2"
- android:layout_alignParentTop="true"
- android:layout_toRightOf="@+id/button1"
- android:text="RadioButton" >
- </RadioButton>
-
- <Button
- android:id="@+id/button2"
- android:layout_width="wrap_content"
- android:layout_height="150dip"
- android:layout_alignParentTop="true"
- android:layout_toRightOf="@+id/radioButton1"
- android:text="Button" >
- </Button>
-
-</RelativeLayout> \ 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/sample6.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info
deleted file mode 100644
index 7a7a44ab5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info
+++ /dev/null
@@ -1,5 +0,0 @@
-android.widget.LinearLayout [0,36,240,320] <LinearLayout>
- android.widget.Button [0,38,49,74] <Button>
- android.widget.RadioButton [49,36,143,72] <RadioButton>
- android.widget.Button [143,0,192,113] <Button>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml
deleted file mode 100644
index 5cdc82493..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:baselineAligned="true">
- <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
- <RadioButton android:text="RadioButton" android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
- <Button android:layout_width="wrap_content" android:id="@+id/button2" android:text="Button" android:layout_height="150dip"></Button>
-</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
deleted file mode 100644
index 8a01599a6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
+++ /dev/null
@@ -1,10 +0,0 @@
-@@ -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
deleted file mode 100644
index 3de135d77..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
+++ /dev/null
@@ -1,69 +0,0 @@
-@@ -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/sample7.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info
deleted file mode 100644
index 134234c44..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info
+++ /dev/null
@@ -1,11 +0,0 @@
-android.widget.LinearLayout [0,0,240,320] <LinearLayout>
- android.widget.Button [0,0,101,36] <Button>
- android.widget.LinearLayout [0,36,240,72] <LinearLayout>
- android.widget.LinearLayout [0,0,73,36] <LinearLayout>
- android.widget.LinearLayout [0,0,73,36] <LinearLayout>
- android.widget.Button [0,0,73,36] <Button>
- android.widget.LinearLayout [0,72,240,192] <LinearLayout>
- android.widget.Button [0,0,117,36] <Button>
- android.widget.Button [117,0,223,36] <Button>
- android.widget.CheckBox [223,10,240,130] <CheckBox>
- android.widget.Button [0,192,240,228] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml
deleted file mode 100644
index 0445bbf8f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<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>
-
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
deleted file mode 100644
index ea3afc2e3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
+++ /dev/null
@@ -1,15 +0,0 @@
-@@ -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
deleted file mode 100644
index 8228b597e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
+++ /dev/null
@@ -1,85 +0,0 @@
-@@ -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/editors/layout/refactoring/testdata/sample8.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info
deleted file mode 100644
index ca294ba10..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info
+++ /dev/null
@@ -1,12 +0,0 @@
-android.widget.LinearLayout [0,0,240,320] <LinearLayout>
- android.widget.Button [0,0,101,36] <Button>
- android.widget.FrameLayout [0,36,240,72] <FrameLayout>
- android.widget.LinearLayout [0,0,240,36] <LinearLayout>
- android.widget.LinearLayout [0,0,73,36] <LinearLayout>
- android.widget.LinearLayout [0,0,73,36] <LinearLayout>
- android.widget.Button [0,0,73,36] <Button>
- android.widget.FrameLayout [0,72,240,108] <FrameLayout>
- android.widget.LinearLayout [0,0,240,36] <LinearLayout>
- android.widget.LinearLayout [0,0,73,36] <LinearLayout>
- android.widget.LinearLayout [0,0,73,36] <LinearLayout>
- android.widget.Button [0,0,73,36] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml
deleted file mode 100644
index c7984692e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<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>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml
deleted file mode 100644
index 03ffac714..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/GridLayout1"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:columnCount="3"
- android:orientation="horizontal" >
-
- <Button
- android:id="@+id/button1"
- android:layout_gravity="left"
- android:text="Button" />
-
- <RadioButton
- android:id="@+id/radioButton1"
- android:layout_width="150dp"
- android:layout_column="0"
- android:layout_gravity="left"
- android:text="RadioButton" />
-
- <RadioButton
- android:id="@+id/radioButton2"
- android:layout_gravity="left"
- android:text="RadioButton" />
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_column="0"
- android:layout_gravity="left"
- android:text="CheckBox" />
-
- <Space
- android:layout_column="2"
- android:layout_gravity="fill_vertical"
- android:layout_row="3" />
-
-</GridLayout> \ 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/sample9.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info
deleted file mode 100644
index 3085ff074..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info
+++ /dev/null
@@ -1,6 +0,0 @@
-android.widget.LinearLayout [0,73,320,480] <LinearLayout>
- android.widget.Button [0,0,79,48] <Button>
- android.widget.LinearLayout [0,48,320,86] <LinearLayout>
- android.widget.RadioButton [0,0,150,38] <RadioButton>
- android.widget.RadioButton [150,0,273,38] <RadioButton>
- android.widget.CheckBox [0,86,107,124] <CheckBox>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml
deleted file mode 100644
index 13068e763..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/LinearLayout1"
- 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="Button" />
-
- <LinearLayout
- android:id="@+id/linearLayout2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" >
-
- <RadioButton
- android:id="@+id/radioButton1"
- android:layout_width="150dp"
- android:layout_height="wrap_content"
- android:text="RadioButton" />
-
- <RadioButton
- android:id="@+id/radioButton2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="RadioButton" />
-
- </LinearLayout>
-
- <CheckBox
- android:id="@+id/checkBox1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="CheckBox" />
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml
deleted file mode 100644
index e5aba11bb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/linear"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/text"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
- <Button
- android:id="@+id/button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
-</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/unwrap-expected-unwrap2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml
deleted file mode 100644
index e5aba11bb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/linear"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/text"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
- <Button
- android:id="@+id/button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
-</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/unwrap-expected-unwrap3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml
deleted file mode 100644
index 348b2bc81..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/frame"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" >
-
- <TextView
- android:id="@+id/text"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
- <Button
- android:id="@+id/button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
-</FrameLayout> \ 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/unwrap.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info
deleted file mode 100644
index c5461b399..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info
+++ /dev/null
@@ -1,4 +0,0 @@
-android.widget.LinearLayout [0,56,1280,104] <LinearLayout>
- android.widget.FrameLayout [0,0,1280,48] <FrameLayout>
- android.widget.TextView [0,0,1280,17] <TextView>
- android.widget.Button [0,0,1280,48] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml
deleted file mode 100644
index db94dc358..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/linear"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
-
- <FrameLayout
- android:id="@+id/frame"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" >
-
- <TextView
- android:id="@+id/text"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
- <Button
- android:id="@+id/button"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
- </FrameLayout>
-
-</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java
deleted file mode 100644
index 43f9d681f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.manifest;
-
-import static com.android.resources.ScreenSize.LARGE;
-import static com.android.resources.ScreenSize.NORMAL;
-import static com.android.resources.ScreenSize.XLARGE;
-
-import com.android.annotations.NonNull;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo.ActivityAttributes;
-import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.BuildToolInfo;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.repository.descriptors.IdDisplay;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-@SuppressWarnings("javadoc")
-public class ManifestInfoTest extends AdtProjectTest {
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- return true;
- }
-
- public void testGetActivityThemes1() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:minSdkVersion='3' android:targetSdkVersion='4'/>\n" +
- "</manifest>\n");
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 0, map.size());
- assertEquals("com.android.unittest", info.getPackage());
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, NORMAL)));
- assertEquals("@android:style/Theme", info.getDefaultTheme(null, null));
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, XLARGE)));
- }
-
- public void testGetActivityThemes2() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:minSdkVersion='3' android:targetSdkVersion='11'/>\n" +
- "</manifest>\n");
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 0, map.size());
- assertEquals("com.android.unittest", info.getPackage());
- assertEquals("Theme.Holo", ResourceHelper.styleToTheme(info.getDefaultTheme(null,
- XLARGE)));
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, LARGE)));
- }
-
- public void testGetActivityThemes3() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:minSdkVersion='11'/>\n" +
- "</manifest>\n");
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 0, map.size());
- assertEquals("com.android.unittest", info.getPackage());
- assertEquals("Theme.Holo", ResourceHelper.styleToTheme(info.getDefaultTheme(null,
- XLARGE)));
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, NORMAL)));
- }
-
- public void testGetActivityThemes4() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <application\n" +
- " android:label='@string/app_name'\n" +
- " android:name='.app.TestApp' android:icon='@drawable/app_icon'>\n" +
- "\n" +
- " <activity\n" +
- " android:name='.prefs.PrefsActivity'\n" +
- " android:label='@string/prefs_title' />\n" +
- "\n" +
- " <activity\n" +
- " android:name='.app.IntroActivity'\n" +
- " android:label='@string/intro_title'\n" +
- " android:theme='@android:style/Theme.Dialog' />\n" +
- " </application>\n" +
- " <uses-sdk android:minSdkVersion='3' android:targetSdkVersion='4'/>\n" +
- "</manifest>\n" +
- ""
- );
- assertEquals("com.android.unittest", info.getPackage());
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, XLARGE)));
-
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 2, map.size());
- assertNull(map.get("com.android.unittest.prefs.PrefsActivity").getTheme());
- assertEquals("@android:style/Theme.Dialog",
- map.get("com.android.unittest.app.IntroActivity").getTheme());
- }
-
- public void testGetActivityThemes5() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <application\n" +
- " android:label='@string/app_name'\n" +
- " android:theme='@style/NoBackground'\n" +
- " android:name='.app.TestApp' android:icon='@drawable/app_icon'>\n" +
- "\n" +
- " <activity\n" +
- " android:name='.prefs.PrefsActivity'\n" +
- " android:label='@string/prefs_title' />\n" +
- "\n" +
- " <activity\n" +
- " android:name='.app.IntroActivity'\n" +
- " android:label='@string/intro_title'\n" +
- " android:theme='@android:style/Theme.Dialog' />\n" +
- " </application>\n" +
- " <uses-sdk android:minSdkVersion='3' android:targetSdkVersion='4'/>\n" +
- "</manifest>\n" +
- ""
- );
-
- assertEquals("@style/NoBackground", info.getDefaultTheme(null, XLARGE));
- assertEquals("@style/NoBackground", info.getDefaultTheme(null, NORMAL));
- assertEquals("NoBackground", ResourceHelper.styleToTheme(info.getDefaultTheme(null,
- NORMAL)));
-
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 2, map.size());
- assertNull(map.get("com.android.unittest.prefs.PrefsActivity").getTheme());
- assertEquals("@android:style/Theme.Dialog",
- map.get("com.android.unittest.app.IntroActivity").getTheme());
- }
-
- public void testGetActivityThemes6() throws Exception {
- // Ensures that when the *rendering* target is less than version 11, we don't
- // use Holo even though the manifest SDK version calls for it.
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:minSdkVersion='3' android:targetSdkVersion='11'/>\n" +
- "</manifest>\n");
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 0, map.size());
- assertEquals("com.android.unittest", info.getPackage());
- assertEquals("Theme.Holo", ResourceHelper.styleToTheme(info.getDefaultTheme(null,
- XLARGE)));
-
- // Here's the check
- IAndroidTarget olderVersion = new TestAndroidTarget(4);
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(olderVersion,
- XLARGE)));
-
- }
-
- public void testGetApplicationLabelAndIcon() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <application android:icon=\"@drawable/icon\"\n" +
- " android:label=\"@string/app_name\">\n" +
- " </application>\n" +
- "" +
- "</manifest>\n");
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 0, map.size());
- assertEquals("com.android.unittest", info.getPackage());
-
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, NORMAL)));
- assertEquals("@drawable/icon", info.getApplicationIcon());
- assertEquals("@string/app_name", info.getApplicationLabel());
- }
-
- public void testGetApplicationNoLabelOrIcon() throws Exception {
- ManifestInfo info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <application>\n" +
- " </application>\n" +
- "" +
- "</manifest>\n");
- Map<String, ActivityAttributes> map = info.getActivityAttributesMap();
- assertEquals(map.toString(), 0, map.size());
- assertEquals("com.android.unittest", info.getPackage());
-
- assertEquals("Theme", ResourceHelper.styleToTheme(info.getDefaultTheme(null, NORMAL)));
- assertNull(info.getApplicationIcon());
- assertNull(info.getApplicationLabel());
- }
-
- private ManifestInfo getManifestInfo(String manifestContents) throws Exception {
- InputStream bstream = new ByteArrayInputStream(
- manifestContents.getBytes("UTF-8")); //$NON-NLS-1$
-
- IFile file = getProject().getFile("AndroidManifest.xml");
- if (file.exists()) {
- file.setContents(bstream, IFile.FORCE, new NullProgressMonitor());
- } else {
- file.create(bstream, false /* force */, new NullProgressMonitor());
- }
- ManifestInfo info = ManifestInfo.get(getProject());
- info.clear();
- return info;
- }
-
- public void testGetMinSdkVersionName() throws Exception {
- ManifestInfo info;
-
- info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:minSdkVersion='3' android:targetSdkVersion='4'/>\n" +
- "</manifest>\n");
- assertEquals(3, info.getMinSdkVersion());
- assertEquals("3", info.getMinSdkName());
- assertEquals(4, info.getTargetSdkVersion());
- assertNull(info.getMinSdkCodeName());
-
- info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:targetSdkVersion='4'/>\n" +
- "</manifest>\n");
- assertEquals("1", info.getMinSdkName());
- assertEquals(1, info.getMinSdkVersion());
- assertEquals(4, info.getTargetSdkVersion());
- assertNull(info.getMinSdkCodeName());
-
- info = getManifestInfo(
- "<manifest xmlns:android='http://schemas.android.com/apk/res/android'\n" +
- " package='com.android.unittest'>\n" +
- " <uses-sdk android:minSdkVersion='JellyBean' />\n" +
- "</manifest>\n");
- assertEquals("JellyBean", info.getMinSdkName());
- assertEquals("JellyBean", info.getMinSdkCodeName());
- }
-
- private static class TestAndroidTarget implements IAndroidTarget {
- private final int mApiLevel;
-
- public TestAndroidTarget(int apiLevel) {
- mApiLevel = apiLevel;
- }
-
- @Override
- public boolean canRunOn(IAndroidTarget target) {
- return false;
- }
-
- @Override
- public String getClasspathName() {
- return null;
- }
-
- @Override
- public File getDefaultSkin() {
- return null;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
- @Override
- public String getFullName() {
- return null;
- }
-
- @Override
- public ISystemImage getSystemImage(IdDisplay tag, String abiType) {
- return null;
- }
-
- @Override
- public ISystemImage[] getSystemImages() {
- return new ISystemImage[0];
- }
-
- @Override
- public String getLocation() {
- return null;
- }
-
- @Override
- public String getName() {
- return null;
- }
-
- @Override
- public IOptionalLibrary[] getOptionalLibraries() {
- return null;
- }
-
- @Override
- public IAndroidTarget getParent() {
- return null;
- }
-
- @Override
- public String getPath(int pathId) {
- return null;
- }
-
- @Override
- public File getFile(int pathId) {
- return null;
- }
-
-
- @Override
- public String[] getPlatformLibraries() {
- return null;
- }
-
- @Override
- public Map<String, String> getProperties() {
- return null;
- }
-
- @Override
- public String getProperty(String name) {
- return null;
- }
-
- @Override
- public Integer getProperty(String name, Integer defaultValue) {
- return null;
- }
-
- @Override
- public Boolean getProperty(String name, Boolean defaultValue) {
- return null;
- }
-
- @Override
- public int getRevision() {
- return 0;
- }
-
- @Override
- public File[] getSkins() {
- return null;
- }
-
- @Override
- public int getUsbVendorId() {
- return 0;
- }
-
- @Override
- public String getVendor() {
- return null;
- }
-
- @Override
- public AndroidVersion getVersion() {
- return new AndroidVersion(mApiLevel, null);
- }
-
- @Override
- public String getVersionName() {
- return null;
- }
-
- @Override
- public String hashString() {
- return null;
- }
-
- @Override
- public boolean isPlatform() {
- return false;
- }
-
- @Override
- public int compareTo(IAndroidTarget o) {
- return 0;
- }
-
- @Override
- public boolean hasRenderingLibrary() {
- return false;
- }
-
- @Override
- public String getShortClasspathName() {
- return null;
- }
-
- @Override
- @NonNull
- public List<String> getBootClasspath() {
- return new ArrayList<String>();
- }
-
- @Override
- public BuildToolInfo getBuildToolInfo() {
- return null;
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/launch/JUnitLaunchConfigDelegateTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/launch/JUnitLaunchConfigDelegateTest.java
deleted file mode 100644
index 58f686adc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/launch/JUnitLaunchConfigDelegateTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2009 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.launch;
-
-import com.android.ide.eclipse.adt.internal.launch.JUnitLaunchConfigDelegate;
-
-import java.io.IOException;
-import java.util.Arrays;
-import junit.framework.TestCase;
-
-public class JUnitLaunchConfigDelegateTest extends TestCase {
-
- public void testAbleToFetchJunitJar() throws IOException {
- assertTrue(JUnitLaunchConfigDelegate.getJunitJarLocation().endsWith("junit.jar"));
- }
-
- public void testFixBootpathExtWithAndroidJar() {
- String[][] testArray = {
- null,
- {},
- { "android.jar"},
- null,
- { "some_other_jar.jar" },
- };
-
- String[][] expectedArray = {
- null,
- {},
- null,
- null,
- { "some_other_jar.jar" },
- };
-
- assertEqualsArrays(expectedArray, JUnitLaunchConfigDelegate.fixBootpathExt(testArray));
- }
-
- public void testFixBootpathExtWithNoAndroidJar() {
- String[][] testArray = {
- null,
- { "somejar.jar"},
- null,
- };
-
- String[][] expectedArray = {
- null,
- { "somejar.jar"},
- null,
- };
-
- assertEqualsArrays(expectedArray, JUnitLaunchConfigDelegate.fixBootpathExt(testArray));
- }
-
- public void testFixClasspathWithJunitJar() throws IOException {
- String[] testArray = {
- JUnitLaunchConfigDelegate.getJunitJarLocation(),
- };
-
- String[] expectedArray = {
- JUnitLaunchConfigDelegate.getJunitJarLocation(),
- };
-
- assertEqualsArrays(expectedArray,
- JUnitLaunchConfigDelegate.fixClasspath(testArray, "test"));
- }
-
- public void testFixClasspathWithoutJunitJar() throws IOException {
- String[] testArray = {
- "random.jar",
- };
-
- String[] expectedArray = {
- "random.jar",
- JUnitLaunchConfigDelegate.getJunitJarLocation(),
- };
-
- assertEqualsArrays(expectedArray,
- JUnitLaunchConfigDelegate.fixClasspath(testArray, "test"));
- }
-
-
- public void testFixClasspathWithNoJars() throws IOException {
- String[] testArray = {
- };
-
- String[] expectedArray = {
- JUnitLaunchConfigDelegate.getJunitJarLocation(),
- };
-
- assertEqualsArrays(expectedArray,
- JUnitLaunchConfigDelegate.fixClasspath(testArray, "test"));
- }
-
- private void assertEqualsArrays(String[][] a1, String[][] a2) {
- assertTrue(Arrays.deepEquals(a1, a2));
- }
-
- private void assertEqualsArrays(String[] a1, String[] a2) {
- assertTrue(Arrays.deepEquals(a1, a2));
- }
-}
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
deleted file mode 100644
index f8ea8c435..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2011 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.lint;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-import com.android.tools.lint.checks.DuplicateIdDetector;
-import com.android.tools.lint.checks.UnusedResourceDetector;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.JavaParser;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.client.api.XmlParser;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.TextFormat;
-
-import org.eclipse.core.resources.IProject;
-
-import java.io.File;
-
-@SuppressWarnings("javadoc")
-public class ProjectLintConfigurationTest extends AdtProjectTest {
- public void testBasic() {
- Configuration parent = null;
- LintClient client = new TestClient();
-
- File dir = getTargetDir();
- if (!dir.exists()) {
- boolean ok = dir.mkdirs();
- assertTrue(dir.getPath(), ok);
- }
- Project project = client.getProject(dir, dir);
-
- ProjectLintConfiguration config =
- new ProjectLintConfiguration(client, project, parent, false /*fatalOnly*/);
-
- Issue usuallyEnabledIssue = DuplicateIdDetector.WITHIN_LAYOUT;
- Issue usuallyDisabledIssue = UnusedResourceDetector.ISSUE_IDS;
-
- assertTrue(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
-
- config.setSeverity(usuallyEnabledIssue, Severity.IGNORE);
- config.setSeverity(usuallyDisabledIssue, Severity.ERROR);
- assertFalse(config.isEnabled(usuallyEnabledIssue));
- assertTrue(config.isEnabled(usuallyDisabledIssue));
-
- // Make a NEW config object to ensure the state is persisted properly, not just
- // kept on the config object!
- config = new ProjectLintConfiguration(client, project, parent, false /*fatalOnly*/);
- assertFalse(config.isEnabled(usuallyEnabledIssue));
- assertTrue(config.isEnabled(usuallyDisabledIssue));
- }
-
- public void testInheritance() {
- Configuration parent = null;
- LintClient client = new TestClient();
-
- File dir = getTargetDir();
- assertTrue(dir.mkdirs());
- Project project = client.getProject(dir, dir);
-
- File otherDir = new File(dir, "otherConfig");
- assertTrue(otherDir.mkdir());
- Project otherProject = client.getProject(otherDir, otherDir);
-
- ProjectLintConfiguration otherConfig =
- new ProjectLintConfiguration(client, otherProject, parent, false);
-
- ProjectLintConfiguration config =
- new ProjectLintConfiguration(client, project, otherConfig, false);
-
- Issue usuallyEnabledIssue = DuplicateIdDetector.WITHIN_LAYOUT;
- Issue usuallyDisabledIssue = UnusedResourceDetector.ISSUE_IDS;
-
- assertTrue(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
-
- otherConfig.setSeverity(usuallyEnabledIssue, Severity.IGNORE);
- otherConfig.setSeverity(usuallyDisabledIssue, Severity.ERROR);
-
- // Ensure inheritance works
- assertFalse(config.isEnabled(usuallyEnabledIssue));
- assertTrue(config.isEnabled(usuallyDisabledIssue));
-
- // Revert
- otherConfig.setSeverity(usuallyEnabledIssue, Severity.ERROR);
- otherConfig.setSeverity(usuallyDisabledIssue, Severity.IGNORE);
- assertTrue(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
-
- // Now override in child
- config.setSeverity(usuallyEnabledIssue, Severity.ERROR);
- config.setSeverity(usuallyDisabledIssue, Severity.IGNORE);
- assertTrue(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
-
- // Now change in parent: no change in child
- otherConfig.setSeverity(usuallyEnabledIssue, Severity.IGNORE);
- otherConfig.setSeverity(usuallyDisabledIssue, Severity.ERROR);
- assertTrue(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
- assertFalse(otherConfig.isEnabled(usuallyEnabledIssue));
- assertTrue(otherConfig.isEnabled(usuallyDisabledIssue));
-
- // Clear override in child
- config.setSeverity(usuallyEnabledIssue, null);
- config.setSeverity(usuallyDisabledIssue, null);
- assertFalse(config.isEnabled(usuallyEnabledIssue));
- assertTrue(config.isEnabled(usuallyDisabledIssue));
- }
-
- public void testBulkEditing() {
- Configuration parent = null;
- LintClient client = new TestClient();
-
- File dir = getTargetDir();
- assertTrue(dir.mkdirs());
- Project project = client.getProject(dir, dir);
-
- ProjectLintConfiguration config =
- new ProjectLintConfiguration(client, project, parent, false /*fatalOnly*/);
-
- Issue usuallyEnabledIssue = DuplicateIdDetector.WITHIN_LAYOUT;
- Issue usuallyDisabledIssue = UnusedResourceDetector.ISSUE_IDS;
-
- assertTrue(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
-
- config.setSeverity(usuallyEnabledIssue, Severity.IGNORE);
- assertFalse(config.isEnabled(usuallyEnabledIssue));
- assertFalse(config.isEnabled(usuallyDisabledIssue));
-
- File configFile = new File(dir, "lint.xml");
- assertTrue(configFile.getPath(), configFile.exists());
- long lastModified = configFile.lastModified();
-
- // We need to make sure that the timestamp of the file is a couple of seconds
- // after the last update or we can't tell whether the file was updated or not
-
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- System.err.println("Sleep interrupted, test may not work.");
- }
- config.startBulkEditing();
- assertFalse(lastModified < configFile.lastModified());
- assertEquals(lastModified, configFile.lastModified());
- config.setSeverity(usuallyDisabledIssue, Severity.ERROR);
- config.finishBulkEditing();
- assertTrue(lastModified < configFile.lastModified());
-
- assertTrue(config.isEnabled(usuallyDisabledIssue));
- }
-
- public void testPersistence() {
- // Ensure that we use the same configuration object repeatedly for a
- // single project, such that we don't recompute and parse XML for each and
- // every lint run!
- IProject project = getProject();
- TestClient client = new TestClient();
- ProjectLintConfiguration config1 = ProjectLintConfiguration.get(client, project, false);
- ProjectLintConfiguration config2 = ProjectLintConfiguration.get(client, project, false);
- assertSame(config1, config2);
- }
-
- @Override
- protected File getTargetDir() {
- File targetDir = new File(getTempDir(), getClass().getSimpleName() + "_" + getName());
- addCleanupDir(targetDir);
- return targetDir;
- }
-
- private static class TestClient extends LintClient {
- @Override
- public void report(@NonNull Context context, @NonNull Issue issue,
- @NonNull Severity severity, @Nullable Location location,
- @NonNull String message, @NonNull TextFormat format) {
- }
-
- @Override
- public void log(@NonNull Severity severity, @Nullable Throwable exception,
- @Nullable String format, @Nullable Object... args) {
- }
-
- @Override
- public XmlParser getXmlParser() {
- return null;
- }
-
- @Override
- public @NonNull String readFile(@NonNull File file) {
- return null;
- }
-
- @Override
- public JavaParser getJavaParser(@Nullable Project project) {
- return null;
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java
deleted file mode 100644
index 1df0b0c5e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * 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.annotations.NonNull;
-import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
-import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-
-/**
- * TODO: Test renaming a DIFFERENT package than the application package!
- */
-@SuppressWarnings({"javadoc", "restriction"})
-public class AndroidPackageRenameParticipantTest extends RefactoringTestBase {
- public void testRefactor1() throws Exception {
- renamePackage(
- TEST_PROJECT,
- false /*renameSubpackages*/,
- true /*updateReferences*/,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename package 'com.example.refactoringtest' to 'my.pkg.name'\n" +
- "\n" +
- "[x] MainActivity.java - /testRefactor1/src/com/example/refactoringtest/MainActivity.java\n" +
- " @@ -3 +3\n" +
- " + import com.example.refactoringtest.R;\n" +
- " +\n" +
- "\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactor1/res/layout/activity_main.xml\n" +
- " @@ -33 +33\n" +
- " - <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
- " + <fragment android:name=\"my.pkg.name.MyFragment\"/>\n" +
- "\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\n" +
- " @@ -16 +16\n" +
- " - android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " + android:name=\"my.pkg.name.MainActivity\"\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\"my.pkg.name.MainActivity2\"",
- true);
- }
-
- public void testRefactor1_noreferences() throws Exception {
- renamePackage(
- TEST_PROJECT,
- false /*renameSubpackages*/,
- false /*updateReferences*/,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename package 'com.example.refactoringtest' to 'my.pkg.name'",
- false);
- }
-
- public void testRefactor2() throws Exception {
- // Tests custom view handling
- renamePackage(
- TEST_PROJECT2,
- false /*renameSubpackages*/,
- true /*updateReferences*/,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename package 'com.example.refactoringtest' to 'my.pkg.name'\n" +
- "\n" +
- "[x] MainActivity.java - /testRefactor2/src/com/example/refactoringtest/MainActivity.java\n" +
- " @@ -3 +3\n" +
- " + import com.example.refactoringtest.R;\n" +
- " +\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2/res/layout/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <my.pkg.name.CustomView1\n" +
- "\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactor2/res/layout/activity_main.xml\n" +
- " @@ -33 +33\n" +
- " - <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
- " + <fragment android:name=\"my.pkg.name.MyFragment\"/>\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2/res/layout-land/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <my.pkg.name.CustomView1\n" +
- "\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor2/AndroidManifest.xml\n" +
- " @@ -16 +16\n" +
- " - android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " + android:name=\"my.pkg.name.MainActivity\"\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\"my.pkg.name.MainActivity2\"",
- true);
- }
-
- public void testRefactor2_renamesub() throws Exception {
- // Tests custom view handling
- renamePackage(
- TEST_PROJECT2,
- true /*renameSubpackages*/,
- true /*updateReferences*/,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename package 'com.example.refactoringtest' and subpackages to 'my.pkg.name'\n" +
- "\n" +
- "[x] MainActivity.java - /testRefactor2_renamesub/src/com/example/refactoringtest/MainActivity.java\n" +
- " @@ -3 +3\n" +
- " + import com.example.refactoringtest.R;\n" +
- " +\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2_renamesub/res/layout/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <my.pkg.name.CustomView1\n" +
- "\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactor2_renamesub/res/layout/activity_main.xml\n" +
- " @@ -33 +33\n" +
- " - <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
- " + <fragment android:name=\"my.pkg.name.MyFragment\"/>\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2_renamesub/res/layout-land/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <my.pkg.name.CustomView1\n" +
- "\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor2_renamesub/AndroidManifest.xml\n" +
- " @@ -16 +16\n" +
- " - android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " + android:name=\"my.pkg.name.MainActivity\"\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\"my.pkg.name.MainActivity2\"\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2_renamesub/res/layout/customviews.xml\n" +
- " @@ -15 +15\n" +
- " - <com.example.refactoringtest.subpackage.CustomView2\n" +
- " + <my.pkg.name.subpackage.CustomView2\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2_renamesub/res/layout-land/customviews.xml\n" +
- " @@ -15 +15\n" +
- " - <com.example.refactoringtest.subpackage.CustomView2\n" +
- " + <my.pkg.name.subpackage.CustomView2",
- true);
- }
-
- public void testRefactor2_renamesub_norefs() throws Exception {
- // Tests custom view handling
- renamePackage(
- TEST_PROJECT2,
- true /*renameSubpackages*/,
- false /*updateReferences*/,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename package 'com.example.refactoringtest' and subpackages to 'my.pkg.name'",
- false);
- }
-
-
- // ---- Test infrastructure ----
-
- protected void renamePackage(
- @NonNull Object[] testData,
- boolean renameSubpackages,
- boolean updateReferences,
- @NonNull String newName,
- @NonNull String expected,
- boolean expectedAppPackageRenameWarning) throws Exception {
- IProject project = createProject(testData);
- String expectedWarnings = expectedAppPackageRenameWarning ?
- EXPECTED_WARNINGS_TEMPLATE.replace("PROJECTNAME", project.getName()) : null;
- renamePackage(project, renameSubpackages, updateReferences, newName, expected,
- expectedWarnings);
- }
-
- protected void renamePackage(
- @NonNull IProject project,
- boolean renameSubpackages,
- boolean updateReferences,
- @NonNull String newName,
- @NonNull String expected,
- @NonNull String expectedWarnings) throws Exception {
- ManifestInfo info = ManifestInfo.get(project);
- String currentPackage = info.getPackage();
- assertNotNull(currentPackage);
-
- IPackageFragment pkgFragment = getPackageFragment(project, currentPackage);
- RenamePackageProcessor processor = new RenamePackageProcessor(pkgFragment);
- processor.setNewElementName(newName);
- processor.setRenameSubpackages(renameSubpackages);
- processor.setUpdateReferences(updateReferences);
- assertNotNull(processor);
-
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- checkRefactoring(refactoring, expected, expectedWarnings);
- }
-
- private static IPackageFragment getPackageFragment(IProject project, String pkg)
- throws CoreException, JavaModelException {
- IPackageFragment pkgFragment = null;
- IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
- assertNotNull(javaProject);
- IPackageFragment[] fragments = javaProject.getPackageFragments();
- for (IPackageFragment fragment : fragments) {
- String name = fragment.getElementName();
- if (pkg.equals(name)) {
- pkgFragment = fragment;
- break;
- }
- }
- return pkgFragment;
- }
-
- private static String EXPECTED_WARNINGS_TEMPLATE =
- "<INFO\n" +
- "\t\n" +
- "INFO: You are refactoring the same package as your application's package (specified in the manifest).\n" +
- "\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- "\t\n" +
- "INFO: Note that this refactoring does NOT also update your application package.\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- "\t\n" +
- "INFO: The application package defines your application's identity.\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- "\t\n" +
- "INFO: If you change it, then it is considered to be a different application.\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- "\t\n" +
- "INFO: (Users of the previous version cannot update to the new version.)\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- "\t\n" +
- "INFO: The application package, and the package containing the code, can differ.\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- "\t\n" +
- "INFO: To really change application package, choose \"Android Tools\" > \"Rename Application Package.\" from the project context menu.\n" +
- "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
- "code: none\n" +
- "Data: null\n" +
- ">";
-}
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
deleted file mode 100644
index 41838e24b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * 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.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
-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.RenameCompilationUnitChange;
-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.MoveResourceChange;
-import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange;
-import org.eclipse.text.edits.TextEdit;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-@SuppressWarnings({"javadoc","restriction"})
-public abstract class RefactoringTestBase extends AdtProjectTest {
- protected void checkRefactoring(Refactoring refactoring, String expected) throws Exception {
- checkRefactoring(refactoring, expected, null);
- }
-
- @Override
- protected void setUp() throws Exception {
- // Not calling super.setUp
- }
-
- protected void checkRefactoring(Refactoring refactoring, String expected,
- @Nullable String expectedWarnings) throws Exception {
- RefactoringStatus status = refactoring.checkAllConditions(new NullProgressMonitor());
- assertNotNull(status);
- if (expectedWarnings == null) {
- expectedWarnings = "<OK\n>";
- }
- if (status.toString().trim().startsWith(
- "<WARNING\n" +
- "\t\n" +
- "WARNING: Code modification may not be accurate as affected resource '")) {
- // Test instability, probably a timing issue with getting the new project
- // compiled (to recognize Android classpath entries)
- // Just continue to ensure that the refactoring list matches.
- } else {
- assertEquals(status.toString().trim(), expectedWarnings.trim());
- }
- if (!status.isOK()) {
- 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 mProject;
-
- @Override
- protected IProject getProject() {
- return mProject;
- }
-
- protected IProject createProject(Object[] testData) throws Exception {
- String name = getName();
- IProject project = createProject(name);
- mProject = project;
- 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);
- if (change.isEnabled()) {
- sb.append("[x] ");
- } else {
- sb.append("[ ] ");
- }
- sb.append(changeName);
-
- IFile file = getFile(change);
- if (file != null) {
- sb.append(" - ");
- sb.append(file.getFullPath());
- sb.append('\n');
- } else {
- sb.append('\n');
- }
-
- if (change instanceof TextFileChange) {
- assertNotNull(file);
- if (file != null) {
- TextChange tc = (TextChange) change;
- TextEdit edit = tc.getEdit();
- byte[] bytes = ByteStreams.toByteArray(file.getContents());
- String before = new String(bytes, Charsets.UTF_8);
- IDocument document = new Document();
- document.replace(0, 0, before);
- // Make a copy: edits are sometimes destructive when run repeatedly!
- edit.copy().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 RenameCompilationUnitChange) {
- // Change name, appended above, is adequate
- } 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 MoveResourceChange) {
- // Change name, appended above, is adequate
- } 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();
- List<Change> sorted = Arrays.asList(children);
- // Process children in a fixed (output-alphabetical) order to ensure stable output
- Collections.sort(sorted, new Comparator<Change>() {
- @Override
- public int compare(Change change1, Change change2) {
- try {
- IFile file1 = getFile(change1);
- IFile file2 = getFile(change2);
- if (file1 != null && file2 != null) {
- // Sort in decreasing order. This places the most interesting
- // files first: res > src > gen
- int fileDelta = file2.getFullPath().toOSString().compareToIgnoreCase(
- file1.getFullPath().toOSString());
- if (fileDelta != 0) {
- return fileDelta;
- }
- }
-
- int nameDelta = change2.getName().compareTo(change1.getName());
- if (nameDelta != 0) {
- return nameDelta;
- }
-
- // This is pretty inefficient but ensures stable output
- return describe(change2).compareTo(describe(change1));
- } catch (Exception e) {
- fail(e.getLocalizedMessage());
- return 0;
- }
- }
-
- });
- for (Change child : sorted) {
- describe(sb, child, indent + (composite.isSynthetic() ? 0 : 1));
- }
- }
- }
-
- @Nullable
- private static IFile getFile(@NonNull Change change) {
- if (change instanceof TextFileChange) {
- TextFileChange tfc = (TextFileChange) change;
- return tfc.getFile();
- }
-
- return null;
- }
-
- 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" +
- " <activity\n" +
- " android:name=\".MainActivity2\"\n" +
- " android:label=\"@string/app_name2\" >\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_MAIN_ACTIVITY2 =
- "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 MainActivity2 extends Activity {\n" +
- "\n" +
- " @Override\n" +
- " protected void onCreate(Bundle savedInstanceState) {\n" +
- " super.onCreate(savedInstanceState);\n" +
- " }\n" +
- "\n" +
- "}\n";
-
- protected static final String MY_FRAGMENT =
- "package com.example.refactoringtest;\n" +
- "import android.support.v4.app.ListFragment;\n" +
- "\n" +
- "public class MyFragment extends ListFragment {\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" +
- " <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>" +
- "\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" +
- " <ListView\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " tools:listitem=\"@layout/preview\" >\n" +
- " </ListView>\n" +
- "\n" +
- " <fragment\n" +
- " android:name=\"android.support.v4.app.ListFragment\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " tools:layout=\"@layout/preview\" />\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,
-
- "src/com/example/refactoringtest/MainActivity2.java",
- SAMPLE_MAIN_ACTIVITY2,
-
- "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,
- };
-
- // More test data
-
- protected static final String CUSTOM_VIEW_1 =
- "package com.example.refactoringtest;\n" +
- "\n" +
- "import android.content.Context;\n" +
- "import android.widget.Button;\n" +
- "\n" +
- "public class CustomView1 extends Button {\n" +
- " public CustomView1(Context context) {\n" +
- " super(context);\n" +
- " }\n" +
- "}\n";
-
- protected static final String CUSTOM_VIEW_1_STYLES =
- "<resources>\n" +
- "\n" +
- " <!-- Aattributes for the custom view -->\n" +
- " <declare-styleable name=\"CustomView1\">\n" +
- " <attr name=\"exampleString\" format=\"string\" />\n" +
- " <attr name=\"exampleDimension\" format=\"dimension\" />\n" +
- " <attr name=\"exampleColor\" format=\"color\" />\n" +
- " <attr name=\"exampleDrawable\" format=\"color|reference\" />\n" +
- " </declare-styleable>\n" +
- "\n" +
- "</resources>";
-
- protected static final String CUSTOM_VIEW_2 =
- "package com.example.refactoringtest.subpackage;\n" +
- "\n" +
- "import android.content.Context;\n" +
- "import android.widget.Button;\n" +
- "\n" +
- "public class CustomView2 extends Button {\n" +
- " public CustomView2(Context context) {\n" +
- " super(context);\n" +
- " }\n" +
- "}\n";
-
- protected static final String CUSTOM_VIEW_LAYOUT =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<LinearLayout 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" +
- " android:orientation=\"vertical\"\n" +
- " tools:ignore=\"HardcodedText\" >\n" +
- "\n" +
- " <com.example.refactoringtest.CustomView1\n" +
- " android:id=\"@+id/customView1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:text=\"CustomView1\" />\n" +
- "\n" +
- " <com.example.refactoringtest.subpackage.CustomView2\n" +
- " android:id=\"@+id/customView2\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:text=\"CustomView2\" />\n" +
- "\n" +
- "</LinearLayout>";
-
- protected static final Object[] TEST_PROJECT2 = new Object[] {
- "AndroidManifest.xml",
- SAMPLE_MANIFEST,
-
- "src/com/example/refactoringtest/MainActivity.java",
- SAMPLE_MAIN_ACTIVITY,
-
- "src/com/example/refactoringtest/CustomView1.java",
- CUSTOM_VIEW_1,
-
- "res/values/attrs_custom_view.xml",
- CUSTOM_VIEW_1_STYLES,
-
- "src/com/example/refactoringtest/subpackage/CustomView2.java",
- CUSTOM_VIEW_2,
-
- "src/com/example/refactoringtest/MyFragment.java",
- MY_FRAGMENT,
-
- "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/layout/customviews.xml",
- CUSTOM_VIEW_LAYOUT,
-
- "res/layout-land/customviews.xml",
- CUSTOM_VIEW_LAYOUT,
-
- "res/menu/activity_main.xml",
- SAMPLE_MENU,
-
- "res/values/strings.xml", // file 3
- SAMPLE_STRINGS,
-
- "res/values/styles.xml", // file 3
- SAMPLE_STYLES,
-
- // Just a gen file, should not be refactored
- "bin/AndroidManifest.xml",
- SAMPLE_MANIFEST,
-
- };
-
-
- protected static final String MANIFEST =
- "/* 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 Manifest {\n" +
- " public static final class permission {\n" +
- " public static final String WRITE_SCHEDULE=\"com.example.refactoringtest.permission.WRITE_SCHEDULE\";\n" +
- " }\n" +
- "}";
-
- protected static final String BUILD_CONFIG =
- "/** Automatically generated file. DO NOT MODIFY */\n" +
- "package com.example.refactoringtest;\n" +
- "\n" +
- "public final class BuildConfig {\n" +
- " public final static boolean DEBUG = true;\n" +
- "}";
-
- protected static final String MORE_CODE_JAVA =
- "package com.example.refactoringtest.subpkg;\n" +
- "\n" +
- "import android.os.Bundle;\n" +
- "import android.app.Activity;\n" +
- "import android.view.Menu;\n" +
- "import android.view.View;\n" +
- "import com.example.refactoringtest.BuildConfig;\n" +
- "import com.example.refactoringtest.Manifest;\n" +
- "import com.example.refactoringtest.R;\n" +
- "\n" +
- "public class MoreCode extends Activity {\n" +
- "\n" +
- " protected void code() {\n" +
- " if (BuildConfig.DEBUG) {\n" +
- " System.out.println(Manifest.permission);\n" +
- " }" +
- " System.out.println(com.example.refactoringtest.BuildConfig.DEBUG);\n" +
- " }\n" +
- "\n" +
- "}\n";
-
- /** Project which includes references to BuildConfig, Manifest, and R */
- protected static final Object[] TEST_PROJECT3;
- static {
- Object[] additional = new Object[] {
- "src/com/example/refactoringtest/subpkg/MoreCode.java",
- MORE_CODE_JAVA,
-
- "gen/com/example/refactoringtest/BuildConfig.java",
- BUILD_CONFIG,
-
- "gen/com/example/refactoringtest/Manifest.java",
- MANIFEST,
- };
- TEST_PROJECT3 = new Object[TEST_PROJECT2.length + additional.length];
- System.arraycopy(TEST_PROJECT2, 0, TEST_PROJECT3, 0, TEST_PROJECT2.length);
- System.arraycopy(additional, 0, TEST_PROJECT3, TEST_PROJECT2.length, additional.length);
- };
-}
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
deleted file mode 100644
index 3f029b93b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * 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.annotations.NonNull;
-import com.android.ide.common.resources.ResourceUrl;
-import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
-import com.android.resources.ResourceType;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-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.ltk.core.refactoring.participants.RenameProcessor;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-
-@SuppressWarnings({"javadoc", "restriction"})
-public class RenameResourceParticipantTest extends RefactoringTestBase {
- public void testRefactor1() throws Exception {
- renameResource(
- TEST_PROJECT,
- "@string/app_name",
- true /*updateReferences*/,
- "myname",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] strings.xml - /testRefactor1/res/values/strings.xml\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" +
- " @@ -29 +29\n" +
- " - public static final int app_name=0x7f040000;\n" +
- " + public static final int myname=0x7f040000;\n" +
- "\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\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\" >");
- }
-
- public void testRefactor2() throws Exception {
- renameResource(
- TEST_PROJECT,
- "@+id/menu_settings",
- true /*updateReferences*/,
- "new_id_for_the_action_bar",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] activity_main.xml - /testRefactor2/res/menu/activity_main.xml\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" +
- " @@ -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 {
- renameResource(
- TEST_PROJECT,
- "@+id/textView1",
- true /*updateReferences*/,
- "output",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] activity_main.xml - /testRefactor3/res/layout/activity_main.xml\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" +
- "[x] MainActivity.java - /testRefactor3/src/com/example/refactoringtest/MainActivity.java\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" +
- " @@ -20 +20\n" +
- " - public static final int textView1=0x7f070000;\n" +
- " + public static final int output=0x7f070000;");
- }
-
- public void testRefactor4() throws Exception {
- renameResource(
- TEST_PROJECT,
- // same as testRefactor3, but use @id rather than @+id even though @+id is in file
- "@id/textView1",
- true /*updateReferences*/,
- "output",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] activity_main.xml - /testRefactor4/res/layout/activity_main.xml\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" +
- "[x] MainActivity.java - /testRefactor4/src/com/example/refactoringtest/MainActivity.java\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" +
- " @@ -20 +20\n" +
- " - public static final int textView1=0x7f070000;\n" +
- " + public static final int output=0x7f070000;");
- }
-
- public void testRefactor5() throws Exception {
- renameResource(
- TEST_PROJECT,
- "@layout/activity_main",
- true /*updateReferences*/,
- "newlayout",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] MainActivity.java - /testRefactor5/src/com/example/refactoringtest/MainActivity.java\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" +
- " @@ -23 +23\n" +
- " - public static final int activity_main=0x7f030000;\n" +
- " + public static final int newlayout=0x7f030000;\n" +
- "\n" +
- "\n" +
- "[x] Rename 'testRefactor5/res/layout/activity_main.xml' to 'newlayout.xml'\n" +
- "\n" +
- "[x] Rename 'testRefactor5/res/layout-land/activity_main.xml' to 'newlayout.xml'");
- }
-
- public void testRefactor6() throws Exception {
- renameResource(
- TEST_PROJECT,
- "@drawable/ic_launcher",
- true /*updateReferences*/,
- "newlauncher",
-
- "CHANGES:\n" +
- "-------\n" +
- "[ ] R.java - /testRefactor6/gen/com/example/refactoringtest/R.java\n" +
- " @@ -14 +14\n" +
- " - public static final int ic_launcher=0x7f020000;\n" +
- " + public static final int newlauncher=0x7f020000;\n" +
- "\n" +
- "\n" +
- "[x] Rename 'testRefactor6/res/drawable-xhdpi/ic_launcher.png' to 'newlauncher.png'\n" +
- "\n" +
- "[x] Rename 'testRefactor6/res/drawable-mdpi/ic_launcher.png' to 'newlauncher.png'\n" +
- "\n" +
- "[x] Rename 'testRefactor6/res/drawable-ldpi/ic_launcher.png' to 'newlauncher.png'\n" +
- "\n" +
- "[x] Rename 'testRefactor6/res/drawable-hdpi/ic_launcher.png' to 'newlauncher.png'\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor6/AndroidManifest.xml\n" +
- " @@ -12 +12\n" +
- " - android:icon=\"@drawable/ic_launcher\"\n" +
- " + android:icon=\"@drawable/newlauncher\"");
- }
-
- 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");
- renameResource(
- project,
- file,
- true /*updateReferences*/,
- "newlayout",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] MainActivity.java - /testRefactor7/src/com/example/refactoringtest/MainActivity.java\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" +
- " @@ -23 +23\n" +
- " - public static final int activity_main=0x7f030000;\n" +
- " + public static final int newlayout=0x7f030000;\n" +
- "\n" +
- "\n" +
- "[x] Rename 'testRefactor7/res/layout-land/activity_main.xml' to 'newlayout.xml'\n" +
- "\n" +
- "[x] Rename 'testRefactor7/res/layout/activity_main.xml' to 'newlayout.xml'",
- null);
- }
-
- public void testRefactor8() throws Exception {
- // Test refactoring initiated on a Java field rename
- IProject project = createProject(TEST_PROJECT);
- IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
- assertNotNull(javaProject);
- IType type = javaProject.findType("com.example.refactoringtest.R.layout");
- if (type == null || !type.exists()) {
- type = javaProject.findType("com.example.refactoringtest.R$layout");
- System.out.println("Had to switch to $ notation");
- }
- assertNotNull(type);
- assertTrue(type.exists());
- IField field = type.getField("activity_main");
- assertNotNull(field);
- assertTrue(field.exists());
-
- renameResource(
- project,
- field,
- true /*updateReferences*/,
- "newlauncher",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename 'testRefactor8/res/layout/activity_main.xml' to 'newlauncher.xml'\n" +
- "\n" +
- "[x] Rename 'testRefactor8/res/layout-land/activity_main.xml' to 'newlauncher.xml'\n" +
- "\n" +
- "[x] MainActivity.java - /testRefactor8/src/com/example/refactoringtest/MainActivity.java\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" +
- " @@ -23 +23\n" +
- " - public static final int activity_main=0x7f030000;\n" +
- " + public static final int newlauncher=0x7f030000;",
- null);
- }
-
- public void testInvalidName() throws Exception {
- renameResource(
- TEST_PROJECT,
- "@drawable/ic_launcher",
- true /*updateReferences*/,
- "Newlauncher",
-
- "",
- "<ERROR\n" +
- "\t\n" +
- "ERROR: File-based resource names must start with a lowercase letter.\n" +
- "Context: <Unspecified context>\n" +
- "code: none\n" +
- "Data: null\n" +
- ">");
- }
-
- public void testRefactor9() throws Exception {
- // same as testRefactor4, but not updating references
- renameResource(
- TEST_PROJECT,
- "@id/textView1",
- false /*updateReferences*/,
- "output",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] activity_main.xml - /testRefactor9/res/layout/activity_main.xml\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" +
- " @@ -20 +20\n" +
- " - public static final int textView1=0x7f070000;\n" +
- " + public static final int output=0x7f070000;");
- }
-
- public void testRefactor10() throws Exception {
- // Check updating tools: attributes
- renameResource(
- TEST_PROJECT,
- "@layout/preview",
- true /*updateReferences*/,
- "newlayout",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] activity_main.xml - /testRefactor10/res/layout-land/activity_main.xml\n" +
- " @@ -10 +10\n" +
- " - tools:listitem=\"@layout/preview\" >\n" +
- " + tools:listitem=\"@layout/newlayout\" >\n" +
- " @@ -17 +17\n" +
- " - tools:layout=\"@layout/preview\" />\n" +
- " + tools:layout=\"@layout/newlayout\" />");
- }
-
- // ---- Test infrastructure ----
-
- protected void renameResource(
- @NonNull Object[] testData,
- @NonNull Object resource,
- boolean updateReferences,
- @NonNull String newName,
- @NonNull String expected) throws Exception {
- renameResource(testData, resource, updateReferences, newName, expected, null);
- }
-
- protected void renameResource(
- @NonNull Object[] testData,
- @NonNull Object resource,
- boolean updateReferences,
- @NonNull String newName,
- @NonNull String expected,
- @NonNull String expectedWarnings) throws Exception {
- IProject project = createProject(testData);
- renameResource(project, resource, updateReferences, newName, expected, expectedWarnings);
- }
-
- protected void renameResource(
- @NonNull IProject project,
- @NonNull Object resource,
- boolean updateReferences,
- @NonNull String newName,
- @NonNull String expected,
- @NonNull String expectedWarnings) throws Exception {
- RenameProcessor processor = null;
- if (resource instanceof String) {
- String url = (String) resource;
- assert url.startsWith("@") : resource;
-
- ResourceUrl parsedUrl = ResourceUrl.parse(url);
- assertNotNull(url, parsedUrl);
- assert parsedUrl != null; // null analysis doesn't recognize assertNotNull
- ResourceType type = parsedUrl.type;
- String currentName = parsedUrl.name;
- RenameResourceProcessor p;
- p = new RenameResourceProcessor(project, type, currentName, newName);
- p.setUpdateReferences(updateReferences);
- processor = p;
- } else if (resource instanceof IResource) {
- IResource r = (IResource) resource;
- org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor p;
- p = new org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor(r);
- String fileName = r.getName();
- int dot = fileName.indexOf('.');
- String extension = (dot != -1) ? fileName.substring(dot) : "";
- p.setNewResourceName(newName + extension);
- p.setUpdateReferences(updateReferences);
- processor = p;
- } else if (resource instanceof IField) {
- RenameFieldProcessor p = new RenameFieldProcessor((IField) resource);
- p.setNewElementName(newName);
- p.setUpdateReferences(updateReferences);
- processor = p;
- } else {
- fail("Unsupported resource element in tests: " + resource);
- }
-
- assertNotNull(processor);
-
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- checkRefactoring(refactoring, expected, expectedWarnings);
- }
-} \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java
deleted file mode 100644
index 0ac034430..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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.renamepackage;
-
-import com.android.annotations.NonNull;
-import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
-import com.android.ide.eclipse.adt.internal.refactorings.core.RefactoringTestBase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Name;
-
-@SuppressWarnings("javadoc")
-public class ApplicationPackageNameRefactoringTest extends RefactoringTestBase {
- public void testRefactor1() throws Exception {
- renamePackage(
- TEST_PROJECT,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] MainActivity.java - /testRefactor1/src/com/example/refactoringtest/MainActivity.java\n" +
- " @@ -7 +7\n" +
- " + import my.pkg.name.R;\n" +
- "\n" +
- "\n" +
- "[x] Make Manifest edits - /testRefactor1/AndroidManifest.xml\n" +
- " @@ -3 +3\n" +
- " - package=\"com.example.refactoringtest\"\n" +
- " + package=\"my.pkg.name\"\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\"com.example.refactoringtest.MainActivity2\"");
- }
-
- public void testRefactor2() throws Exception {
- // Tests custom view handling
- renamePackage(
- TEST_PROJECT2,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] MainActivity.java - /testRefactor2/src/com/example/refactoringtest/MainActivity.java\n" +
- " @@ -7 +7\n" +
- " + import my.pkg.name.R;\n" +
- "\n" +
- "\n" +
- "[x] Make Manifest edits - /testRefactor2/AndroidManifest.xml\n" +
- " @@ -3 +3\n" +
- " - package=\"com.example.refactoringtest\"\n" +
- " + package=\"my.pkg.name\"\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\"com.example.refactoringtest.MainActivity2\"");
- }
-
- public void testRefactor3() throws Exception {
- // Tests BuildConfig imports and updates
- renamePackage(
- TEST_PROJECT3,
- "my.pkg.name",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] MoreCode.java - /testRefactor3/src/com/example/refactoringtest/subpkg/MoreCode.java\n" +
- " @@ -7 +7\n" +
- " - import com.example.refactoringtest.BuildConfig;\n" +
- " - import com.example.refactoringtest.Manifest;\n" +
- " - import com.example.refactoringtest.R;\n" +
- " + import my.pkg.name.BuildConfig;\n" +
- " + import my.pkg.name.Manifest;\n" +
- " + import my.pkg.name.R;\n" +
- "\n" +
- "\n" +
- "[x] MainActivity.java - /testRefactor3/src/com/example/refactoringtest/MainActivity.java\n" +
- " @@ -7 +7\n" +
- " + import my.pkg.name.R;\n" +
- "\n" +
- "\n" +
- "[x] Make Manifest edits - /testRefactor3/AndroidManifest.xml\n" +
- " @@ -3 +3\n" +
- " - package=\"com.example.refactoringtest\"\n" +
- " + package=\"my.pkg.name\"\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\"com.example.refactoringtest.MainActivity2\"");
- }
-
- // ---- Test infrastructure ----
-
- protected void renamePackage(
- @NonNull Object[] testData,
- @NonNull String newName,
- @NonNull String expected) throws Exception {
- IProject project = createProject(testData);
- renamePackage(project, newName, expected);
- }
-
- protected void renamePackage(
- @NonNull IProject project,
- @NonNull String newName,
- @NonNull String expected) throws Exception {
- ManifestInfo info = ManifestInfo.get(project);
- String currentPackage = info.getPackage();
- assertNotNull(currentPackage);
-
- final AST astValidator = AST.newAST(AST.JLS3);
- Name oldPackageName = astValidator.newName(currentPackage);
- Name newPackageName = astValidator.newName(newName);
- ApplicationPackageNameRefactoring refactoring =
- new ApplicationPackageNameRefactoring(project, oldPackageName, newPackageName);
- checkRefactoring(refactoring, expected);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/exportgradle/ExportGradleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/exportgradle/ExportGradleTest.java
deleted file mode 100644
index f5cc58bcf..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/exportgradle/ExportGradleTest.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (C) 2013 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.wizards.exportgradle;
-
-import static com.android.sdklib.internal.project.ProjectProperties.PROPERTY_LIBRARY;
-
-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.layout.refactoring.AdtProjectTest;
-import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
-import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
-import com.android.ide.eclipse.adt.internal.sdk.Sdk;
-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.sdklib.internal.project.ProjectPropertiesWorkingCopy;
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-
-public class ExportGradleTest extends AdtProjectTest {
- private QualifiedName ERROR_KEY = new QualifiedName(AdtPlugin.PLUGIN_ID, "JobErrorKey");
- private Throwable mLastThrown;
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- mLastThrown = null;
- }
-
- @Override
- protected boolean testCaseNeedsUniqueProject() {
- return true;
- }
-
- public void testSimpleAndroidApp() throws Throwable {
- IProject project = getProject("simple-app");
- final IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
-
- final ProjectSetupBuilder builder = new ProjectSetupBuilder();
- builder.setProject(Collections.singletonList(javaProject));
-
- Job job = new Job("Validate project") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- BuildFileCreator.createBuildFiles(builder, null, monitor);
- File buildfile = new File(javaProject.getResource().getLocation().toString(),
- BuildFileCreator.BUILD_FILE);
- assertTrue(buildfile.exists());
- String contents = Files.toString(buildfile, Charsets.UTF_8);
- String expectedContents =
- "buildscript {\n" +
- " repositories {\n" +
- " " + BuildFileCreator.MAVEN_REPOSITORY + "\n" +
- " }\n" +
- " dependencies {\n" +
- " " + BuildFileCreator.PLUGIN_CLASSPATH + "\n" +
- " }\n" +
- "}\n" +
- "apply plugin: 'android'\n" +
- "\n" +
- "dependencies {\n" +
- "}\n" +
- "\n" +
- "android {\n" +
- " compileSdkVersion 16\n" +
- " buildToolsVersion \"16\"\n" +
- "\n" +
- " defaultConfig {\n" +
- " minSdkVersion 1\n" +
- " targetSdkVersion 1\n" +
- " }\n" +
- " sourceSets {\n" +
- " main {\n" +
- " manifest.srcFile 'AndroidManifest.xml'\n" +
- " java.srcDirs = ['src']\n" +
- " resources.srcDirs = ['src']\n" +
- " aidl.srcDirs = ['src']\n" +
- " renderscript.srcDirs = ['src']\n" +
- " res.srcDirs = ['res']\n" +
- " assets.srcDirs = ['assets']\n" +
- " }\n" +
- " instrumentTest.setRoot('tests')\n" +
- " }\n" +
- "}";
-
- assertEqualsWhitespaceInsensitive(expectedContents, contents);
- } catch (Throwable t) {
- mLastThrown = t;
- }
- return null;
- }
- };
- job.schedule(1000);
- job.join();
- Object property = job.getProperty(ERROR_KEY);
- assertNull(property);
- if (mLastThrown != null) {
- throw mLastThrown;
- }
- }
-
- public void testSimpleAndroidLib() throws Throwable {
- final IProject project = getProject("simple-library");
- ProjectState projectState = Sdk.getProjectState(project.getProject());
- ProjectPropertiesWorkingCopy propertiesWorkingCopy = projectState.getProperties().makeWorkingCopy();
- propertiesWorkingCopy.setProperty(PROPERTY_LIBRARY, "true");
- propertiesWorkingCopy.save();
- IResource projectProp = project.findMember(SdkConstants.FN_PROJECT_PROPERTIES);
- if (projectProp != null) {
- projectProp.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
- }
-
- Job job = new Job("Validate project") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
-
- final ProjectSetupBuilder builder = new ProjectSetupBuilder();
- builder.setProject(Collections.singletonList(javaProject));
-
- BuildFileCreator.createBuildFiles(builder, null, monitor);
- File buildfile = new File(javaProject.getResource().getLocation().toString(),
- BuildFileCreator.BUILD_FILE);
- assertTrue(buildfile.exists());
- String contents = Files.toString(buildfile, Charsets.UTF_8);
- String expectedContents =
- "buildscript {\n" +
- " repositories {\n" +
- " " + BuildFileCreator.MAVEN_REPOSITORY + "\n" +
- " }\n" +
- " dependencies {\n" +
- " " + BuildFileCreator.PLUGIN_CLASSPATH + "\n" +
- " }\n" +
- "}\n" +
- "apply plugin: 'android-library'\n" +
- "\n" +
- "dependencies {\n" +
- "}\n" +
- "\n" +
- "android {\n" +
- " compileSdkVersion 16\n" +
- " buildToolsVersion \"16\"\n" +
- "\n" +
- " defaultConfig {\n" +
- " minSdkVersion 1\n" +
- " targetSdkVersion 1\n" +
- " }\n" +
- " sourceSets {\n" +
- " main {\n" +
- " manifest.srcFile 'AndroidManifest.xml'\n" +
- " java.srcDirs = ['src']\n" +
- " resources.srcDirs = ['src']\n" +
- " aidl.srcDirs = ['src']\n" +
- " renderscript.srcDirs = ['src']\n" +
- " res.srcDirs = ['res']\n" +
- " assets.srcDirs = ['assets']\n" +
- " }\n" +
- " instrumentTest.setRoot('tests')\n" +
- " }\n" +
- "}";
-
- assertEqualsWhitespaceInsensitive(expectedContents, contents);
- } catch (Throwable t) {
- mLastThrown = t;
- }
- return null;
- }
- };
- job.schedule(1000);
- job.join();
- Object property = job.getProperty(ERROR_KEY);
- assertNull(property);
- if (mLastThrown != null) {
- throw mLastThrown;
- }
- }
-
- public void testPlainJavaProject() throws Throwable {
- IProject project = getJavaProject("simple-java");
- final IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
-
- final ProjectSetupBuilder builder = new ProjectSetupBuilder();
- builder.setProject(Collections.singletonList(javaProject));
-
- BuildFileCreator.createBuildFiles(builder, null, null);
- Job job = new Job("Validate project") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- File buildfile = new File(javaProject.getResource().getLocation().toString(), "build.gradle");
- assertTrue(buildfile.exists());
- String contents = Files.toString(buildfile, Charsets.UTF_8);
- String expectedContents =
- "apply plugin: 'java'\n" +
- "sourceSets {\n" +
- " main.java.srcDirs = ['src']\n" +
- "}";
-
- assertEqualsWhitespaceInsensitive(expectedContents, contents);
- } catch (Throwable t) {
- mLastThrown = t;
- }
- return null;
- }
- };
- job.schedule(1000);
- job.join();
- Object property = job.getProperty(ERROR_KEY);
- assertNull(property);
- if (mLastThrown != null) {
- throw mLastThrown;
- }
- }
-
- protected IProject getProject(String projectName) {
- IProject project = createProject(projectName);
- assertNotNull(project);
- if (!testCaseNeedsUniqueProject() && !testNeedsUniqueProject()) {
- addCleanupDir(AdtUtils.getAbsolutePath(project).toFile());
- }
- addCleanupDir(project.getFullPath().toFile());
- return project;
- }
-
- protected IProject getJavaProject(String projectName) {
- IProject project = createJavaProject(projectName);
- assertNotNull(project);
- if (!testCaseNeedsUniqueProject() && !testNeedsUniqueProject()) {
- addCleanupDir(AdtUtils.getAbsolutePath(project).toFile());
- }
- addCleanupDir(project.getFullPath().toFile());
- return project;
- }
-
- protected IProject createJavaProject(String name) {
- IRunnableContext context = new IRunnableContext() {
- @Override
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
- throws InvocationTargetException, InterruptedException {
- runnable.run(new NullProgressMonitor());
- }
- };
- NewProjectWizardState state = new NewProjectWizardState(Mode.ANY);
- state.projectName = name;
- state.packageName = TEST_PROJECT_PACKAGE;
- state.activityName = name;
- state.applicationName = name;
- state.createActivity = false;
- state.useDefaultLocation = true;
- if (getMinSdk() != -1) {
- state.minSdk = Integer.toString(getMinSdk());
- }
-
- NewProjectCreator creator = new NewProjectCreator(state, context);
- creator.createJavaProjects();
- return validateProjectExists(name);
- }
-
- /**
- * Compares two strings, disregarding whitespace. This makes the test less brittle with respect
- * to insignificant changes.
- */
- protected void assertEqualsWhitespaceInsensitive(String a, String b) {
- a = stripWhitespace(a);
- b = stripWhitespace(b);
- assertEquals("Expected:\n" + a + "\nbut was:\n" + b + "\n\n", a, b);
- }
-
- protected String stripWhitespace(String s) {
- return s.replaceAll("\\s","");
- }
-} \ 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
deleted file mode 100644
index 9d3bc60c6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
+++ /dev/null
@@ -1,901 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import static com.android.SdkConstants.CURRENT_PLATFORM;
-import static com.android.SdkConstants.FD_TOOLS;
-import static com.android.SdkConstants.PLATFORM_WINDOWS;
-import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_API;
-import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_BUILD_API;
-import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.ATTR_ID;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.sdklib.SdkVersionInfo;
-import com.android.ide.eclipse.adt.AdtPlugin;
-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.SdkLoadingTestCase;
-import com.android.sdklib.IAndroidTarget;
-import com.android.utils.GrabProcessOutput;
-import com.android.utils.GrabProcessOutput.IProcessOutput;
-import com.android.utils.GrabProcessOutput.Wait;
-import com.android.tools.lint.checks.ManifestDetector;
-import com.android.tools.lint.checks.SecurityDetector;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.DefaultConfiguration;
-import com.android.tools.lint.client.api.JavaParser;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.client.api.XmlParser;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.TextFormat;
-import com.google.common.base.Charsets;
-import com.google.common.base.Stopwatch;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.common.io.Files;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.w3c.dom.Element;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Unit tests for template instantiation.
- * <p>
- * Note: This test can take multiple hours to run!
- *
- * <p>
- * TODO: Test all permutations of variables (it currently just varies one at a time with the
- * rest of the defaults)
- * TODO: Test trying to change strings arguments (currently just varies enums and booleans)
- * TODO: Test adding multiple instances of the templates (to look for resource conflicts)
- */
-@SuppressWarnings("javadoc")
-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
- * all the versions for each template first
- */
- private static final boolean TEST_FEWER_API_VERSIONS = true;
- private static final boolean TEST_JUST_ONE_MIN_SDK = false;
- private static final boolean TEST_JUST_ONE_BUILD_TARGET = true;
- private static final boolean TEST_JUST_ONE_TARGET_SDK_VERSION = true;
- private QualifiedName ERROR_KEY = new QualifiedName(AdtPlugin.PLUGIN_ID, "JobErrorKey");
- private static int sCount = 0;
- /**
- * If true, check this template with all the interesting (
- * {@link #isInterestingApiLevel(int)}) api versions
- */
- private boolean mApiSensitiveTemplate;
- /**
- * Set of templates already tested with separate unit test; remainder is
- * checked in {@link #testCreateRemainingProjects()}
- */
- private static final Set<File> sProjectTestedSeparately = Sets.newHashSet();
- /**
- * Set of templates already tested with separate unit test; remainder is
- * checked in {@link #testCreateRemainingTemplates()}
- */
- private static final Set<File> sTemplateTestedSeparately = Sets.newHashSet();
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mApiSensitiveTemplate = true;
- }
-
- /**
- * Is the given api level interesting for testing purposes? This is used to
- * skip gaps, such that we for example only check say api 8, 9, 11, 14, etc
- * -- versions where the <b>templates</b> are doing conditional changes. To
- * be EXTRA comprehensive, occasionally try returning true unconditionally
- * here to test absolutely everything.
- */
- private boolean isInterestingApiLevel(int api) {
- // For templates that aren't API sensitive, only test with API = 16
- if (!mApiSensitiveTemplate) {
- return api == 16;
- }
-
- switch (api) {
- case 1:
- case 8:
- return true;
- case 11:
- return true;
- case 14:
- return true;
- case 9:
- case 16:
- return !TEST_FEWER_API_VERSIONS;
- default:
- return false;
- }
- }
-
- public void testNewBlankProject() throws Exception {
- Stopwatch stopwatch = Stopwatch.createUnstarted();
- stopwatch.start();
- checkProjectWithActivity(null);
- stopwatch.stop();
- System.out.println("Checked blank project successfully in "
- + stopwatch.toString());
- }
-
- public void testNewBlankActivity() throws Exception {
- checkCreateTemplate("activities", "BlankActivity");
- }
-
- public void testBlankActivityInProject() throws Exception {
- checkCreateActivityInProject("BlankActivity");
- }
-
- public void testNewMasterDetailFlow() throws Exception {
- checkCreateTemplate("activities", "MasterDetailFlow");
- }
-
- public void testMasterDetailFlowInProject() throws Exception {
- checkCreateActivityInProject("MasterDetailFlow");
- }
-
- public void testNewFullscreen() throws Exception {
- checkCreateTemplate("activities", "FullscreenActivity");
- }
-
- public void testFullscreenInProject() throws Exception {
- checkCreateActivityInProject("FullscreenActivity");
- }
-
- public void testNewLoginActivity() throws Exception {
- checkCreateTemplate("activities", "LoginActivity");
- }
-
- public void testLoginActivityInProject() throws Exception {
- checkCreateActivityInProject("MasterDetailFlow");
- }
-
- public void testNewSettingsActivity() throws Exception {
- checkCreateTemplate("activities", "SettingsActivity");
- }
-
- public void testSettingsActivityInProject() throws Exception {
- checkCreateActivityInProject("SettingsActivity");
- }
-
- public void testNewBroadcastReceiver() throws Exception {
- // No need to try this template with multiple platforms, one is adequate
- mApiSensitiveTemplate = false;
- checkCreateTemplate("other", "BroadcastReceiver");
- }
-
- public void testNewContentProvider() throws Exception {
- mApiSensitiveTemplate = false;
- checkCreateTemplate("other", "ContentProvider");
- }
-
- public void testNewCustomView() throws Exception {
- mApiSensitiveTemplate = false;
- checkCreateTemplate("other", "CustomView");
- }
-
- public void testNewService() throws Exception {
- mApiSensitiveTemplate = false;
- checkCreateTemplate("other", "Service");
- }
-
- public void testCreateRemainingTemplates() throws Exception {
- sCount = 0;
- long begin = System.currentTimeMillis();
- TemplateManager manager = new TemplateManager();
- List<File> other = manager.getTemplates("other");
- for (File templateFile : other) {
- if (sTemplateTestedSeparately.contains(templateFile)) {
- continue;
- }
- checkTemplate(templateFile);
- }
- // Also try creating templates, not as part of creating a project
- List<File> activities = manager.getTemplates("activities");
- for (File templateFile : activities) {
- if (sTemplateTestedSeparately.contains(templateFile)) {
- continue;
- }
- checkTemplate(templateFile);
- }
- long end = System.currentTimeMillis();
- System.out.println("Successfully checked " + sCount + " template permutations in "
- + ((end - begin) / (1000 * 60)) + " minutes");
- }
-
- public void testCreateRemainingProjects() throws Exception {
- sCount = 0;
- long begin = System.currentTimeMillis();
- TemplateManager manager = new TemplateManager();
- List<File> templates = manager.getTemplates("activities");
- for (File activityFile : templates) {
- if (sTemplateTestedSeparately.contains(activityFile)) {
- continue;
- }
- checkProjectWithActivity(activityFile.getName());
- }
- long end = System.currentTimeMillis();
- System.out.println("Successfully checked " + sCount + " project permutations in "
- + ((end - begin) / (1000 * 60)) + " minutes");
- }
-
- // ---- Test support code below ----
-
- private void checkCreateActivityInProject(String activityName) throws Exception {
- Stopwatch stopwatch = Stopwatch.createUnstarted();
- stopwatch.start();
- File templateFile = findTemplate("activities", activityName);
- sProjectTestedSeparately.add(templateFile);
- checkProjectWithActivity(templateFile.getName());
- stopwatch.stop();
- System.out.println("Checked " + templateFile.getName() + " successfully in "
- + stopwatch.toString());
- }
-
- private void checkCreateTemplate(String category, String name) throws Exception {
- Stopwatch stopwatch = Stopwatch.createUnstarted();
- stopwatch.start();
- File templateFile = findTemplate(category, name);
- assertNotNull(templateFile);
- sTemplateTestedSeparately.add(templateFile);
- checkTemplate(templateFile);
- stopwatch.stop();
- System.out.println("Checked " + templateFile.getName() + " successfully in "
- + stopwatch.toString());
- }
-
- private static File findTemplate(String category, String name) {
- File templateRootFolder = TemplateManager.getTemplateRootFolder();
- assertNotNull(templateRootFolder);
- File file = new File(templateRootFolder, category + File.separator + name);
- assertTrue(file.getPath(), file.exists());
- return file;
- }
-
- private void checkTemplate(File templateFile) throws Exception {
- NewProjectWizardState values = new NewProjectWizardState();
- values.applicationName = "My Application";
- values.packageName = "my.pkg2";
-
- values.isLibrary = false;
- values.createIcon = false;
- values.useDefaultLocation = true;
- values.createActivity = false;
-
- String projectNameBase = "MyTemplateProject_" + templateFile.getName();
- values.projectName = projectNameBase;
- values.createActivity = false;
-
- // Create the new template
-
- NewTemplateWizardState state = new NewTemplateWizardState();
- state.setTemplateLocation(templateFile);
- state.minSdkLevel = values.minSdkLevel;
-
- // Iterate over all (valid) combinations of build target, minSdk and targetSdk
- IAndroidTarget[] targets = Sdk.getCurrent().getTargets();
- for (int i = targets.length - 1; i >= 0; i--) {
- IAndroidTarget target = targets[i];
- if (!target.isPlatform()) {
- continue;
- }
- if (!isInterestingApiLevel(target.getVersion().getApiLevel())) {
- continue;
- }
-
- for (int minSdk = 1;
- minSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
- minSdk++) {
- // Don't bother checking *every* single minSdk, just pick some interesting ones
- if (!isInterestingApiLevel(minSdk)) {
- continue;
- }
-
- for (int targetSdk = minSdk;
- targetSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
- targetSdk++) {
- if (!isInterestingApiLevel(targetSdk)) {
- continue;
- }
-
- // Make sure this template is supported with these versions
- IStatus status = values.template.validateTemplate(
- minSdk, target.getVersion().getApiLevel());
- if (status != null && !status.isOK()) {
- continue;
- }
-
- // Also make sure activity is enabled for these versions
- status = state.getTemplateHandler().validateTemplate(
- minSdk, target.getVersion().getApiLevel());
- if (status != null && !status.isOK()) {
- continue;
- }
-
- // Iterate over all new new project templates
-
- // should I try all options of theme with all platforms?
- // or just try all platforms, with one setting for each?
- // doesn't seem like I need to multiply
- // just pick the best setting that applies instead for each platform
- List<Parameter> parameters = values.template.getTemplate().getParameters();
- projectParameters:
- for (Parameter parameter : parameters) {
- List<Element> options = parameter.getOptions();
- if (parameter.type == Parameter.Type.ENUM) {
- for (Element element : options) {
- Option option = Option.get(element);
- String optionId = option.id;
- int optionMinSdk = option.minSdk;
- int optionMinBuildApi = option.minBuild;
- if (optionMinSdk <= minSdk &&
- optionMinBuildApi <= target.getVersion().getApiLevel()) {
- values.parameters.put(parameter.id, optionId);
- if (parameter.id.equals("baseTheme")) {
- String base = projectNameBase + "_min_" + minSdk
- + "_target_" + targetSdk
- + "_build_" + target.getVersion().getApiLevel()
- + "_theme_" + optionId;
- System.out.println("checking base " + base);
-
- checkApiTarget(minSdk, targetSdk, target, values, base,
- state);
- break projectParameters;
- }
- }
- }
- }
- }
-
- if (TEST_JUST_ONE_TARGET_SDK_VERSION) {
- break;
- }
- }
-
- if (TEST_JUST_ONE_MIN_SDK) {
- break;
- }
- }
-
- if (TEST_JUST_ONE_BUILD_TARGET) {
- break;
- }
- }
- }
-
- private void checkProjectWithActivity(String activity) throws Exception {
- NewProjectWizardState values = new NewProjectWizardState();
- values.applicationName = "My Application";
- values.packageName = "my.pkg";
-
- values.isLibrary = false;
- values.createIcon = false;
- values.useDefaultLocation = true;
-
- // These are basically unused; passed as defaults
- values.activityName = activity == null ? "Blank" : activity;
- values.activityTitle = "My Activity Title";
-
- String projectNameBase = "MyProject_" + values.activityName;
- values.projectName = projectNameBase;
-
- values.createActivity = activity != null;
- NewTemplateWizardState activityValues = values.activityValues;
- assertNotNull(activityValues);
- activityValues.minSdkLevel = values.minSdkLevel;
-
-
- // Iterate over all (valid) combinations of build target, minSdk and targetSdk
- IAndroidTarget[] targets = Sdk.getCurrent().getTargets();
- for (int i = targets.length - 1; i >= 0; i--) {
- IAndroidTarget target = targets[i];
- if (!target.isPlatform()) {
- continue;
- }
- if (!isInterestingApiLevel(target.getVersion().getApiLevel())) {
- continue;
- }
-
- for (int minSdk = 1;
- minSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
- minSdk++) {
- // Don't bother checking *every* single minSdk, just pick some interesting ones
- if (!isInterestingApiLevel(minSdk)) {
- continue;
- }
-
- for (int targetSdk = minSdk;
- targetSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
- targetSdk++) {
- if (!isInterestingApiLevel(targetSdk)) {
- continue;
- }
-
- // Make sure this template is supported with these versions
- IStatus status = values.template.validateTemplate(
- values.minSdkLevel, values.getBuildApi());
- if (status != null && !status.isOK()) {
- continue;
- }
-
- // Also make sure activity is enabled for these versions
- status = values.activityValues.getTemplateHandler().validateTemplate(
- values.minSdkLevel, values.getBuildApi());
- if (status != null && !status.isOK()) {
- continue;
- }
-
- // Iterate over all new new project templates
-
- // should I try all options of theme with all platforms?
- // or just try all platforms, with one setting for each?
- // doesn't seem like I need to multiply
- // just pick the best setting that applies instead for each platform
- List<Parameter> parameters = values.template.getTemplate().getParameters();
- for (Parameter parameter : parameters) {
- List<Element> options = parameter.getOptions();
- if (parameter.type == Parameter.Type.ENUM) {
- for (Element element : options) {
- Option option = Option.get(element);
- String optionId = option.id;
- int optionMinSdk = option.minSdk;
- int optionMinBuildApi = option.minBuild;
- if (optionMinSdk <= minSdk &&
- optionMinBuildApi <= target.getVersion().getApiLevel()) {
- values.parameters.put(parameter.id, optionId);
- if (parameter.id.equals("baseTheme")) {
- String base = projectNameBase + "_min_" + minSdk
- + "_target_" + targetSdk
- + "_build_" + target.getVersion().getApiLevel()
- + "_theme_" + optionId;
- System.out.println("checking base " + base);
-
- checkApiTarget(minSdk, targetSdk, target, values, base,
- null);
-
- }
- }
- }
- }
- }
-
- if (TEST_JUST_ONE_TARGET_SDK_VERSION) {
- break;
- }
- }
-
- if (TEST_JUST_ONE_MIN_SDK) {
- break;
- }
- }
-
- if (TEST_JUST_ONE_BUILD_TARGET) {
- break;
- }
- }
- }
-
- private void checkApiTarget(
- int minSdk,
- int targetSdk,
- @NonNull IAndroidTarget target,
- @NonNull NewProjectWizardState projectValues,
- @NonNull String projectNameBase,
- @Nullable NewTemplateWizardState templateValues)
- throws Exception {
- NewTemplateWizardState values =
- projectValues.createActivity ? projectValues.activityValues : templateValues;
-
- projectValues.minSdk = Integer.toString(minSdk);
- projectValues.minSdkLevel = minSdk;
- projectValues.targetSdkLevel = targetSdk;
- projectValues.target = target;
-
- if (values == null) {
- checkProject(projectValues, templateValues);
- return;
- }
-
- // Next check all other parameters, cycling through booleans and enums.
- TemplateHandler templateHandler = values.getTemplateHandler();
- TemplateMetadata template = templateHandler.getTemplate();
- assertNotNull(template);
- List<Parameter> parameters = template.getParameters();
-
- if (!projectValues.createActivity) {
- for (Parameter parameter : parameters) {
- values.parameters.put(parameter.id, parameter.value);
- }
- }
-
- for (Parameter parameter : parameters) {
- if (parameter.type == Parameter.Type.SEPARATOR
- || parameter.type == Parameter.Type.STRING) {
- // TODO: Consider whether we should attempt some strings here
- continue;
- }
-
- // The initial (default value); revert to this one after cycling,
- Object initial = values.parameters.get(parameter.id);
-
- if (parameter.type == Parameter.Type.ENUM) {
- List<Element> options = parameter.getOptions();
- for (Element element : options) {
- Option option = Option.get(element);
- String optionId = option.id;
- int optionMinSdk = option.minSdk;
- int optionMinBuildApi = option.minBuild;
- if (projectValues.minSdkLevel >= optionMinSdk &&
- projectValues.getBuildApi() >= optionMinBuildApi) {
- values.parameters.put(parameter.id, optionId);
- projectValues.projectName = projectNameBase + "_" + parameter.id
- + "_" + optionId;
- checkProject(projectValues, templateValues);
- }
- }
- } else {
- assert parameter.type == Parameter.Type.BOOLEAN;
- if (parameter.id.equals("isLauncher") && projectValues.createActivity) {
- // Skipping this one: always true when launched from new project
- continue;
- }
- boolean value = false;
- values.parameters.put(parameter.id, value);
- projectValues.projectName = projectNameBase + "_" + parameter.id
- + "_" + value;
- checkProject(projectValues, templateValues);
-
- value = true;
- values.parameters.put(parameter.id, value);
- projectValues.projectName = projectNameBase + "_" + parameter.id
- + "_" + value;
- checkProject(projectValues, templateValues);
- }
-
- values.parameters.put(parameter.id, initial);
- }
- }
-
- private final class OutputGrabber implements IProcessOutput {
- private final List<String> output = Lists.newArrayList();
- private final List<String> error = Lists.newArrayList();
-
- @Override
- public void out(@Nullable String line) {
- if (line != null) {
- output.add(line);
- }
- }
-
- @Override
- public void err(@Nullable String line) {
- if (line != null) {
- error.add(line);
- }
- }
-
- @NonNull
- private List<String> getOutput() {
- return output;
- }
-
- @NonNull
- private List<String> getError() {
- return error;
- }
- }
-
- private static class Option {
- private String id;
- private int minSdk;
- private int minBuild;
-
- public Option(String id, int minSdk, int minBuild) {
- this.id = id;
- this.minSdk = minSdk;
- this.minBuild = minBuild;
- }
-
- private static Option get(Element option) {
- String optionId = option.getAttribute(ATTR_ID);
- String minApiString = option.getAttribute(ATTR_MIN_API);
- int optionMinSdk = 1;
- if (minApiString != null && !minApiString.isEmpty()) {
- try {
- optionMinSdk = Integer.parseInt(minApiString);
- } catch (NumberFormatException nufe) {
- // Templates aren't allowed to contain codenames, should
- // always be an integer
- AdtPlugin.log(nufe, null);
- optionMinSdk = 1;
- }
- }
- String minBuildApiString = option.getAttribute(ATTR_MIN_BUILD_API);
- int optionMinBuildApi = 1;
- if (minBuildApiString != null && !minBuildApiString.isEmpty()) {
- try {
- optionMinBuildApi = Integer.parseInt(minBuildApiString);
- } catch (NumberFormatException nufe) {
- // Templates aren't allowed to contain codenames, should
- // always be an integer
- AdtPlugin.log(nufe, null);
- optionMinBuildApi = 1;
- }
- }
-
-
- return new Option(optionId, optionMinSdk, optionMinBuildApi);
- }
- }
-
- private void checkProject(
- @NonNull NewProjectWizardState projectValues,
- @Nullable NewTemplateWizardState templateValues) throws Exception {
- NewTemplateWizardState values =
- projectValues.createActivity ? projectValues.activityValues : templateValues;
- if (values != null) { // if not, creating blank project
- // Validate that a template is only being used in a context it is compatible with!
- IStatus status = values.getTemplateHandler().validateTemplate(
- projectValues.minSdkLevel, projectValues.getBuildApi());
- if (status != null && !status.isOK()) {
- fail(status.toString());
- }
- }
-
- assertNotNull(projectValues.projectName);
- projectValues.projectName = AdtUtils.getUniqueProjectName(projectValues.projectName, "");
- IPath workspace = Platform.getLocation();
- String projectLocation = workspace.append(projectValues.projectName).toOSString();
- projectValues.projectLocation = projectLocation;
-
- // Create project with the given parameter map
- final IProject project = createProject(projectValues);
- assertNotNull(project);
-
- if (templateValues != null) {
- templateValues.project = project;
- List<Change> changes = templateValues.computeChanges();
- if (!changes.isEmpty()) {
- try {
- CompositeChange composite = new CompositeChange("",
- changes.toArray(new Change[changes.size()]));
- composite.perform(new NullProgressMonitor());
- } catch (CoreException e) {
- fail(e.getLocalizedMessage());
- }
- }
- }
-
- // Project creation has some async hooks so don't attempt to build it *right* away
- Job job = new Job("Validate project") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- ensureValidProject(this, project);
- return Status.OK_STATUS;
- } catch (Exception e) {
- fail(e.toString());
- }
- return null;
- }
- };
- job.schedule(1000);
- job.join();
- Object property = job.getProperty(ERROR_KEY);
- assertNull(property);
- }
-
- private IProject createProject(NewProjectWizardState values) throws InvocationTargetException {
- NewProjectWizard wizard = new NewProjectWizard();
- wizard.setValues(values);
- wizard.performFinish(new NullProgressMonitor());
-
- if (TemplateHandler.sMostRecentException != null) {
- fail(values.projectName + ": " + TemplateHandler.sMostRecentException.toString());
- }
-
- IProject project = wizard.getProject();
- assertNotNull(project);
- assertTrue(project.exists());
- System.out.println("Created project " + project + " : " + AdtUtils.getAbsolutePath(project));
- return project;
- }
-
- private void ensureValidProject(@NonNull Job job, @NonNull IProject project) throws Exception {
- System.out.println("Begin build error check");
- ensureNoBuildErrors(job, project);
- System.out.println("Finished build error check");
-
- System.out.println("Begin lint check");
- ensureNoLintWarnings(job, project);
- System.out.println("Finished lint check");
-
- sCount++;
- }
-
- private void ensureNoLintWarnings(final Job job, IProject project) {
- System.setProperty("com.android.tools.lint.bindir", AdtPrefs.getPrefs().getOsSdkFolder()
- + File.separator + FD_TOOLS);
-
- LintDriver driver = new LintDriver(EclipseLintClient.getRegistry(), new LintClient() {
- @Override
- public void report(@NonNull Context context,
- @NonNull Issue issue, @NonNull Severity severity,
- @Nullable Location location, @NonNull String message, @NonNull TextFormat format) {
- String s = "Found lint error: " + issue.getId() + ": " + message + " at " + location;
- job.setProperty(ERROR_KEY, s);
- fail(s);
- }
-
- @Override
- public Configuration getConfiguration(@NonNull Project p) {
- return new DefaultConfiguration(this, p, null, new File("dummy.xml")) {
- @Override
- public boolean isEnabled(@NonNull Issue issue) {
- // Doesn't work: hangs in unit test context, something about
- // loading native libs.
- if (issue.getCategory() == Category.ICONS){
- return false;
- }
-
- if (issue == ManifestDetector.TARGET_NEWER) {
- // Don't complain about targetSdk < latest: we're deliberately
- // testing that (to make sure templates compile etc in compat
- // mode)
- return false;
- }
-
- if (issue == SecurityDetector.EXPORTED_SERVICE
- || issue == SecurityDetector.EXPORTED_PROVIDER
- || issue == SecurityDetector.EXPORTED_RECEIVER) {
- // Don't complain about missing permissions when exporting: the
- // unit test is deliberately turning on exported
- return false;
- }
-
- return true;
- }
- };
- }
-
- @Override
- @NonNull
- public String readFile(@NonNull File file) {
- try {
- return Files.toString(file, Charsets.UTF_8);
- } catch (IOException e) {
- fail(e.toString() + " for " + file.getPath());
- return "";
- }
- }
-
- @Override
- public void log(@NonNull Severity severity, @Nullable Throwable exception,
- @Nullable String format, @Nullable Object... args) {
- if (exception != null) {
- exception.printStackTrace();
- }
- if (format != null) {
- if (args != null) {
- System.err.println("Log: " + String.format(format, args));
- } else {
- System.err.println("Unexpected log message " + format);
- }
- }
- }
-
- @Override
- @Nullable
- public JavaParser getJavaParser(@Nullable Project project) {
- return new EclipseLintClient(null, null, null, false).getJavaParser(project);
- }
-
- @Override
- public XmlParser getXmlParser() {
- return new EclipseLintClient(null, null, null, false).getXmlParser();
- }
- });
- File projectDir = AdtUtils.getAbsolutePath(project).toFile();
- assertNotNull(projectDir);
- assertTrue(projectDir.getPath(), projectDir.isDirectory());
- driver.analyze(Collections.singletonList(projectDir), Scope.ALL);
- }
-
- // Wait for test build support.
- // This is copied from {@link SampleProjectTest}
-
- private void ensureNoBuildErrors(final Job job, final IProject project) throws Exception {
- File projectDir = AdtUtils.getAbsolutePath(project).toFile();
-
- // Checking the build in Eclipse doesn't work well, because of asynchronous issues
- // (it looks like not all necessary changes are applied, and even adding waits works
- // unpredictably.)
- //
- // So instead we do it via the command line.
- // First add ant support:
- // $ android update project -p .
- // Then we run ant and look at the exit code to make sure it worked.
-
- List<String> command = new ArrayList<String>();
- command.add(AdtPlugin.getOsSdkToolsFolder() + "android" +
- (CURRENT_PLATFORM == PLATFORM_WINDOWS ? ".bat" : ""));
- command.add("update");
- command.add("project");
- command.add("-p");
- command.add(projectDir.getPath());
-
- // launch the command line process
- Process process = Runtime.getRuntime().exec(command.toArray(new String[command.size()]));
-
-
- OutputGrabber processOutput = new OutputGrabber();
- int status = GrabProcessOutput.grabProcessOutput(
- process,
- Wait.WAIT_FOR_READERS, // we really want to make sure we get all the output!
- processOutput);
- if (status != 0) {
- fail(processOutput.getOutput().toString() + processOutput.getError().toString());
- }
- assertEquals(0, status);
-
- // Run ant
- String antCmd = "ant" + (CURRENT_PLATFORM == PLATFORM_WINDOWS ? ".bat" : "");
- String antTarget = "debug";
- process = Runtime.getRuntime().exec(antCmd + " " + antTarget, null, projectDir);
- processOutput = new OutputGrabber();
- status = GrabProcessOutput.grabProcessOutput(
- process,
- Wait.WAIT_FOR_READERS, // we really want to make sure we get all the output!
- processOutput);
- if (status != 0) {
- fail(processOutput.getOutput().toString() + processOutput.getError().toString());
- }
- assertEquals(0, status);
- System.out.println("Ant succeeded (code=" + status + ")");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java
deleted file mode 100644
index c86f4cf5f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AdtTestData.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.AdtConstants;
-import com.android.ide.eclipse.adt.AdtPlugin;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.logging.Logger;
-
-/**
- * Helper class for retrieving test data
- * <p/>
- * All tests which need to retrieve paths to test data files should go through this class.
- */
-public class AdtTestData {
-
- /** singleton instance */
- private static AdtTestData sInstance = null;
- private static final Logger sLogger = Logger.getLogger(AdtTestData.class.getName());
-
- /** The prefered directory separator to use. */
- private static final String DIR_SEP_STR = "/";
- private static final char DIR_SEP_CHAR = '/';
-
- /** The absolute file path to the plugin's contents. */
- private String mOsRootDataPath;
-
- private AdtTestData() {
- // can set test_data env variable to override default behavior of
- // finding data using class loader
- // useful when running in plugin environment, where test data is inside
- // bundled jar, and must be extracted to temp filesystem location to be
- // accessed normally
- mOsRootDataPath = System.getProperty("test_data");
- if (mOsRootDataPath == null) {
- sLogger.info("Cannot find test_data environment variable, init to class loader");
- URL url = this.getClass().getClassLoader().getResource("."); //$NON-NLS-1$
-
- if (Platform.isRunning()) {
- sLogger.info("Running as an Eclipse Plug-in JUnit test, using FileLocator");
- try {
- mOsRootDataPath = FileLocator.resolve(url).getFile();
- if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_WINDOWS) {
- // Fix the path returned by the URL resolver
- // so that it actually works on Windows.
-
- // First, Windows paths don't start with a / especially
- // if they contain a drive spec such as C:/...
- int pos = mOsRootDataPath.indexOf(':');
- if (pos > 0 && mOsRootDataPath.charAt(0) == '/') {
- mOsRootDataPath = mOsRootDataPath.substring(1);
- }
-
- // Looking for "." probably inserted a /./, so clean it up
- mOsRootDataPath = mOsRootDataPath.replace("/./", "/");
- }
- } catch (IOException e) {
- sLogger.warning("IOException while using FileLocator, reverting to url");
- mOsRootDataPath = url.getFile();
- }
- } else {
- sLogger.info("Running as an plain JUnit test, using url as-is");
- mOsRootDataPath = url.getFile();
- }
- }
-
- if (mOsRootDataPath.equals(AdtConstants.WS_SEP)) {
- sLogger.warning("Resource data not found using class loader!, Defaulting to no path");
- }
-
- if (File.separatorChar == '\\') {
- // On Windows, uniformize all separators to use the / convention
- mOsRootDataPath.replace('\\', DIR_SEP_CHAR);
- }
-
- if (!mOsRootDataPath.endsWith(File.separator) && !mOsRootDataPath.endsWith(DIR_SEP_STR)) {
- sLogger.info("Fixing test_data env variable (does not end with path separator)");
- mOsRootDataPath += DIR_SEP_STR;
- }
- }
-
- /** Get the singleton instance of AdtTestData */
- public static AdtTestData getInstance() {
- if (sInstance == null) {
- sInstance = new AdtTestData();
- }
- return sInstance;
- }
-
- /**
- * Returns the absolute file path to a file located in this plugin.
- *
- * @param osRelativePath {@link String} path to file contained in plugin. Must
- * use path separators appropriate to host OS
- *
- * @return absolute OS path to test file
- */
- public String getTestFilePath(String osRelativePath) {
- File path = new File(mOsRootDataPath, osRelativePath);
-
- if (!path.exists()) {
- // On Windows at least this ends up using the wrong plugin path.
- String pkgAdt = AdtPlugin .class.getPackage().getName();
- String pkgTests = AdtTestData.class.getPackage().getName();
-
- if (mOsRootDataPath.contains(pkgAdt)) {
- path = new File(mOsRootDataPath.replace(pkgAdt, pkgTests), osRelativePath);
- }
-
- assert path.exists();
- }
-
- return path.getAbsolutePath();
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AllTests.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AllTests.java
deleted file mode 100644
index 5386142a8..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/AllTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests;
-
-import junit.framework.TestSuite;
-
-
-/**
- * Container TestSuite for all eclipse tests, both functional and unit
- */
-public class AllTests extends TestSuite {
-
- public AllTests() {
-
- }
-
- /**
- * Returns a suite of test cases to be run.
- */
- public static TestSuite suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(FuncTests.suite());
- suite.addTest(UnitTests.suite());
- return suite;
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/EclipseTestCollector.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/EclipseTestCollector.java
deleted file mode 100644
index 6bbc955ee..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/EclipseTestCollector.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests;
-
-import org.eclipse.core.runtime.Plugin;
-
-import java.lang.reflect.Modifier;
-import java.net.URL;
-import java.util.Enumeration;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Class for collecting all test cases in an eclipse plugin
- *
- */
-public class EclipseTestCollector {
-
- /**
- * Constructor
- */
- public EclipseTestCollector() {
-
- }
-
- /**
- * Searches through given plugin, adding all TestCase classes to given suite
- * @param suite - TestSuite to add to
- * @param plugin - Plugin to search for tests
- * @param expectedPackage - expected package for tests. Only test classes
- * that start with this package name will be added to suite
- */
- @SuppressWarnings({"cast", "unchecked"})
- public void addTestCases(TestSuite suite, Plugin plugin, String expectedPackage) {
- if (plugin != null) {
- Enumeration<?> entries = plugin.getBundle().findEntries("/", "*.class", true);
-
- while (entries.hasMoreElements()) {
- URL entry = (URL)entries.nextElement();
- String filePath = entry.getPath().replace(".class", "");
- try {
- Class<?> testClass = getClass(filePath, expectedPackage);
- if (isTestClass(testClass)) {
- // In Eclipse 3.6 RCP Windows-x64, the signature has changed from
- // addTestSuite(Class)
- // to:
- // addTestSuite(Class<? extends TestCase>)
- // which is enough to create an error. To solve it, we cast into the
- // generics expected by the JUnit framework used by 3.6 and suppress the
- // warnings generated by the compiler under 3.5
- suite.addTestSuite((Class<? extends TestCase>)testClass);
- }
- }
- catch (ClassNotFoundException e) {
- // ignore, this is not the class we're looking for
- //sLogger.log(Level.INFO, "Could not load class " + filePath);
- }
- }
- }
- }
-
- /**
- * Returns true if given class should be added to suite
- */
- protected boolean isTestClass(Class<?> testClass) {
- return TestCase.class.isAssignableFrom(testClass) &&
- Modifier.isPublic(testClass.getModifiers()) &&
- hasPublicConstructor(testClass);
- }
-
- /**
- * Returns true if given class has a public constructor
- */
- @SuppressWarnings({"unchecked", "cast"})
- protected boolean hasPublicConstructor(Class<?> testClass) {
- try {
- // In Eclipse 3.6 RCP Windows-x64, the signature has changed from
- // getTestConstructor(Class)
- // to:
- // getTestConstructor(Class<? extends TestCase>)
- // which is enough to create an error. To solve it, we cast into the
- // generics expected by the JUnit framework used by 3.6 and suppress the
- // warnings generated by the compiler under 3.5
- TestSuite.getTestConstructor((Class<? extends TestCase>) testClass);
- } catch(NoSuchMethodException e) {
- return false;
- }
- return true;
- }
-
- /**
- * Load the class given by the plugin aka bundle file path
- * @param filePath - path of class in bundle
- * @param expectedPackage - expected package of class
- * @throws ClassNotFoundException
- */
- protected Class<?> getClass(String filePath, String expectedPackage) throws ClassNotFoundException {
- String dotPath = filePath.replace('/', '.');
- // remove the output folders, by finding where package name starts
- int index = dotPath.indexOf(expectedPackage);
- if (index == -1) {
- throw new ClassNotFoundException();
- }
- String packagePath = dotPath.substring(index);
- return Class.forName(packagePath);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java
deleted file mode 100644
index efa880126..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/FuncTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests;
-
-import com.android.ide.eclipse.tests.functests.layoutRendering.ApiDemosRenderingTest;
-
-import junit.framework.TestSuite;
-
-/**
- * Container TestSuite for all eclipse tests to be run
- */
-
-public class FuncTests extends TestSuite {
-
- static final String FUNC_TEST_PACKAGE = "com.android.ide.eclipse.tests.functests";
-
- public FuncTests() {
-
- }
-
- /**
- * Returns a suite of test cases to be run.
- * Needed for JUnit3 compliant command line test runner
- */
- public static TestSuite suite() {
- TestSuite suite = new TestSuite();
-
- // TODO: uncomment this when 'gen' folder error on create is fixed
- // suite.addTestSuite(SampleProjectTest.class);
- suite.addTestSuite(ApiDemosRenderingTest.class);
-
- return suite;
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java
deleted file mode 100644
index 65ce8e1d7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests;
-
-import com.android.ide.common.sdk.LoadStatus;
-import com.android.ide.eclipse.adt.AdtPlugin;
-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;
-
-/**
- * A test case which uses the SDK loaded by the ADT plugin.
- */
-public abstract class SdkLoadingTestCase extends SdkTestCase {
-
- private Sdk mSdk;
-
- protected SdkLoadingTestCase() {
- }
-
- /**
- * Retrieve the {@link Sdk} under test.
- */
- protected Sdk getSdk() {
- if (mSdk == null) {
- mSdk = loadSdk();
- assertNotNull(mSdk);
- validateSdk(mSdk);
- }
- return mSdk;
- }
-
- /**
- * Gets the current SDK from ADT, waiting if necessary.
- */
- private Sdk loadSdk() {
- AdtPlugin adt = AdtPlugin.getDefault();
-
- // We'll never get an AdtPlugin object when running this with the
- // non-Eclipse jUnit test runner.
- if (adt == null) {
- return null;
- }
-
- // We'll never break out of the SDK load-wait-loop if the AdtPlugin doesn't
- // actually have a valid SDK location because it won't have started an async load:
- String sdkLocation = AdtPrefs.getPrefs().getOsSdkFolder();
- assertTrue("No valid SDK installation is set; for tests you typically need to set the"
- + " environment variable ADT_TEST_SDK_PATH to point to an SDK folder",
- sdkLocation != null && sdkLocation.length() > 0);
-
- Object sdkLock = Sdk.getLock();
- LoadStatus loadStatus = LoadStatus.LOADING;
- // wait for ADT to load the SDK on a separate thread
- // loop max of 600 times * 200 ms = 2 minutes
- final int maxWait = 600;
- for (int i=0; i < maxWait && loadStatus == LoadStatus.LOADING; i++) {
- try {
- Thread.sleep(200);
- }
- catch (InterruptedException e) {
- // ignore
- }
- synchronized (sdkLock) {
- loadStatus = adt.getSdkLoadStatus();
- }
- }
- Sdk sdk = null;
- synchronized (sdkLock) {
- assertEquals(LoadStatus.LOADED, loadStatus);
- sdk = Sdk.getCurrent();
- }
- assertNotNull(sdk);
- return sdk;
- }
-
- protected boolean validateSdk(IAndroidTarget target) {
- return true;
- }
-
- /**
- * Checks that the provided sdk contains one or more valid targets.
- * @param sdk the {@link Sdk} to validate.
- */
- private void validateSdk(Sdk sdk) {
- assertTrue("sdk has no targets", sdk.getTargets().length > 0);
- for (IAndroidTarget target : sdk.getTargets()) {
- 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/UnitTests.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/UnitTests.java
deleted file mode 100644
index 15d38715c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/UnitTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests;
-
-
-import com.android.ide.eclipse.adt.AdtPlugin;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Container TestSuite for all eclipse unit tests to be run
- *
- * Uses Eclipse OSGI to find and then run all junit.junit.framework.Tests in
- * this plugin, excluding tests in the FuncTests.FUNC_TEST_PACKAGE package
- *
- * Since it uses Eclipse OSGI, it must be run in a Eclipse plugin environment
- * i.e. from Eclipse workbench, this suite must be run using the
- * "JUnit Plug-in Test" launch configuration as opposed to as a "JUnit Test"
- *
- */
-public class UnitTests {
- private static final String TEST_PACKAGE = "com.android";
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
-
- UnitTestCollector collector = new UnitTestCollector();
- // since this plugin is a fragment which runs insde adt, gather tests from AdtPlugin
- collector.addTestCases(suite, AdtPlugin.getDefault(), TEST_PACKAGE);
-
- return suite;
- }
-
- /**
- * Specialized test collector which will skip adding functional tests
- */
- private static class UnitTestCollector extends EclipseTestCollector {
- /**
- * Override parent class to exclude functional tests
- */
- @Override
- protected boolean isTestClass(Class<?> testClass) {
- return super.isTestClass(testClass) &&
- !testClass.getPackage().getName().startsWith(FuncTests.FUNC_TEST_PACKAGE);
- }
- }
-}
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
deleted file mode 100644
index d6b401b62..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (C) 2009 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.tests.functests.layoutRendering;
-
-import com.android.SdkConstants;
-import com.android.ide.common.rendering.LayoutLibrary;
-import com.android.ide.common.rendering.api.ActionBarCallback;
-import com.android.ide.common.rendering.api.AdapterBinding;
-import com.android.ide.common.rendering.api.HardwareConfig;
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.ide.common.rendering.api.IProjectCallback;
-import com.android.ide.common.rendering.api.RenderSession;
-import com.android.ide.common.rendering.api.ResourceReference;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.rendering.api.SessionParams;
-import com.android.ide.common.rendering.api.SessionParams.RenderingMode;
-import com.android.ide.common.resources.ResourceItem;
-import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.common.resources.ResourceResolver;
-import com.android.ide.common.resources.configuration.DensityQualifier;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.common.resources.configuration.KeyboardStateQualifier;
-import com.android.ide.common.resources.configuration.NavigationMethodQualifier;
-import com.android.ide.common.resources.configuration.NavigationStateQualifier;
-import com.android.ide.common.resources.configuration.ScreenDimensionQualifier;
-import com.android.ide.common.resources.configuration.ScreenHeightQualifier;
-import com.android.ide.common.resources.configuration.ScreenOrientationQualifier;
-import com.android.ide.common.resources.configuration.ScreenRatioQualifier;
-import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
-import com.android.ide.common.resources.configuration.ScreenWidthQualifier;
-import com.android.ide.common.resources.configuration.SmallestScreenWidthQualifier;
-import com.android.ide.common.resources.configuration.TextInputMethodQualifier;
-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.SdkLoadingTestCase;
-import com.android.io.FolderWrapper;
-import com.android.resources.Density;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.ResourceType;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-import com.android.sdklib.IAndroidTarget;
-import com.android.util.Pair;
-
-import org.kxml2.io.KXmlParser;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.imageio.ImageIO;
-
-public class ApiDemosRenderingTest extends SdkLoadingTestCase {
-
- /**
- * Custom parser that implements {@link ILayoutPullParser} (which itself extends
- * {@link XmlPullParser}).
- */
- private final static class TestParser extends KXmlParser implements ILayoutPullParser {
- /**
- * Since we're not going to go through the result of the rendering/layout, we can return
- * null for the View Key.
- */
- @Override
- public Object getViewCookie() {
- return null;
- }
-
- @Override
- public ILayoutPullParser getParser(String layoutName) {
- return null;
- }
- }
-
- private final static class ProjectCallBack implements IProjectCallback {
- // resource id counter.
- // We start at 0x7f000000 to avoid colliding with the framework id
- // since we have no access to the project R.java and we need to generate them automatically.
- private int mIdCounter = 0x7f000000;
-
- // in some cases, the id that getResourceValue(String type, String name) returns
- // will be sent back to get the type/name. This map stores the id/type/name we generate
- // to be able to do the reverse resolution.
- private Map<Integer, Pair<ResourceType, String>> mResourceMap =
- new HashMap<Integer, Pair<ResourceType, String>>();
-
- private boolean mCustomViewAttempt = false;
-
- @Override
- public String getNamespace() {
- // TODO: read from the ApiDemos manifest.
- return "com.example.android.apis";
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs)
- throws ClassNotFoundException, Exception {
- mCustomViewAttempt = true;
- return null;
- }
-
- @Override
- public Integer getResourceId(ResourceType type, String name) {
- Integer result = ++mIdCounter;
- mResourceMap.put(result, Pair.of(type, name));
- return result;
- }
-
- @Override
- public Pair<ResourceType, String> resolveResourceId(int id) {
- return mResourceMap.get(id);
- }
-
- @Override
- public String resolveResourceId(int[] id) {
- return null;
- }
-
- @Override
- public ILayoutPullParser getParser(String layoutName) {
- return null;
- }
-
- @Override
- public Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie,
- ResourceReference itemRef, int fullPosition, int typePosition,
- int fullChildPosition, int typeChildPosition,
- ResourceReference viewRef, ViewAttribute viewAttribute, Object defaultValue) {
- return null;
- }
-
- @Override
- public AdapterBinding getAdapterBinding(ResourceReference adapterView,
- Object adapterCookie, Object viewObject) {
- return null;
- }
-
- @Override
- public ILayoutPullParser getParser(ResourceValue layoutResource) {
- return null;
- }
-
- @Override
- public ActionBarCallback getActionBarCallback() {
- return new ActionBarCallback();
- }
- }
-
- public void testApiDemos() throws IOException, XmlPullParserException {
- findApiDemos();
- }
-
- private void findApiDemos() throws IOException, XmlPullParserException {
- IAndroidTarget[] targets = getSdk().getTargets();
-
- for (IAndroidTarget target : targets) {
- String path = target.getPath(IAndroidTarget.SAMPLES);
- File samples = new File(path);
- if (samples.isDirectory()) {
- File[] files = samples.listFiles();
- for (File file : files) {
- if ("apidemos".equalsIgnoreCase(file.getName())) {
- testSample(target, file);
- return;
- }
- }
- }
- }
-
- fail("Failed to find ApiDemos!");
- }
-
- private void testSample(IAndroidTarget target, File sampleProject) throws IOException, XmlPullParserException {
- AndroidTargetData data = getSdk().getTargetData(target);
- if (data == null) {
- fail("No AndroidData!");
- }
-
- LayoutLibrary layoutLib = data.getLayoutLibrary();
- if (layoutLib.getStatus() != LoadStatus.LOADED) {
- fail("Fail to load the bridge: " + layoutLib.getLoadMessage());
- }
-
- FolderWrapper resFolder = new FolderWrapper(sampleProject, SdkConstants.FD_RES);
- if (resFolder.exists() == false) {
- fail("Sample project has no res folder!");
- }
-
- // look for the layout folder
- File layoutFolder = new File(resFolder, SdkConstants.FD_RES_LAYOUT);
- if (layoutFolder.isDirectory() == false) {
- fail("Sample project has no layout folder!");
- }
-
- // first load the project's target framework resource
- ResourceRepository framework = ResourceManager.getInstance().loadFrameworkResources(target);
-
- // now load the project resources
- ResourceRepository project = new ResourceRepository(resFolder, false) {
- @Override
- protected ResourceItem createResourceItem(String name) {
- return new ResourceItem(name);
- }
-
- };
-
- // Create a folder configuration that will be used for the rendering:
- FolderConfiguration config = getConfiguration();
-
- // get the configured resources
- Map<ResourceType, Map<String, ResourceValue>> configuredFramework =
- framework.getConfiguredResources(config);
- Map<ResourceType, Map<String, ResourceValue>> configuredProject =
- project.getConfiguredResources(config);
-
- boolean saveFiles = System.getenv("save_file") != null;
-
- // loop on the layouts and render them
- File[] layouts = layoutFolder.listFiles();
- for (File layout : layouts) {
- // create a parser for the layout file
- TestParser parser = new TestParser();
- parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
- parser.setInput(new FileReader(layout));
-
- System.out.println("Rendering " + layout.getName());
-
- ProjectCallBack projectCallBack = new ProjectCallBack();
-
- ResourceResolver resolver = ResourceResolver.create(
- configuredProject, configuredFramework,
- "Theme", false /*isProjectTheme*/);
-
- HardwareConfig hardwareConfig = new HardwareConfig(
- 320,
- 480,
- Density.MEDIUM,
- 160, //xdpi
- 160, // ydpi
- ScreenSize.NORMAL,
- ScreenOrientation.PORTRAIT,
- false /*software buttons */);
-
- RenderSession session = layoutLib.createSession(new SessionParams(
- parser,
- RenderingMode.NORMAL,
- null /*projectKey*/,
- hardwareConfig,
- resolver,
- projectCallBack,
- 1, // minSdkVersion
- 1, // targetSdkVersion
- null //logger
- ));
-
- if (session.getResult().isSuccess() == false) {
- if (projectCallBack.mCustomViewAttempt == false) {
- System.out.println("FAILED");
- fail(String.format("Rendering %1$s: %2$s", layout.getName(),
- session.getResult().getErrorMessage()));
- } else {
- System.out.println("Ignore custom views for now");
- }
- } else {
- if (saveFiles) {
- File tmp = File.createTempFile(layout.getName(), ".png");
- ImageIO.write(session.getImage(), "png", tmp);
- }
- System.out.println("Success!");
- }
- }
- }
-
- /**
- * Returns a config. This must be a valid config like a device would return. This is to
- * prevent issues where some resources don't exist in all cases and not in the default
- * (for instance only available in hdpi and mdpi but not in default).
- * @return
- */
- private FolderConfiguration getConfiguration() {
- FolderConfiguration config = new FolderConfiguration();
-
- // this matches an ADP1.
- config.addQualifier(new SmallestScreenWidthQualifier(320));
- config.addQualifier(new ScreenWidthQualifier(320));
- config.addQualifier(new ScreenHeightQualifier(480));
- config.addQualifier(new ScreenSizeQualifier(ScreenSize.NORMAL));
- config.addQualifier(new ScreenRatioQualifier(ScreenRatio.NOTLONG));
- config.addQualifier(new ScreenOrientationQualifier(ScreenOrientation.PORTRAIT));
- config.addQualifier(new DensityQualifier(Density.MEDIUM));
- config.addQualifier(new TouchScreenQualifier(TouchScreen.FINGER));
- config.addQualifier(new KeyboardStateQualifier(KeyboardState.HIDDEN));
- config.addQualifier(new TextInputMethodQualifier(Keyboard.QWERTY));
- config.addQualifier(new NavigationStateQualifier(NavigationState.HIDDEN));
- config.addQualifier(new NavigationMethodQualifier(Navigation.TRACKBALL));
- config.addQualifier(new ScreenDimensionQualifier(480, 320));
-
- config.updateScreenWidthAndHeight();
-
- return config;
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/AndroidManifestWriter.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/AndroidManifestWriter.java
deleted file mode 100644
index 141e7e000..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/AndroidManifestWriter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2009 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.tests.functests.sampleProjects;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
-import com.android.xml.AndroidManifest;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-/**
- * Helper class for modifying an AndroidManifest.
- * <p/>
- * TODO: consider merging this with AndroidManifestParser.
- */
-class AndroidManifestWriter {
-
- private static final Logger sLogger = Logger.getLogger(AndroidManifestWriter.class.getName());
-
- private final Document mDoc;
- private final String mOsManifestFilePath;
-
- private AndroidManifestWriter(Document doc, String osManifestFilePath) {
- mDoc = doc;
- mOsManifestFilePath = osManifestFilePath;
- }
-
- /**
- * Sets the minimum SDK version for this manifest
- * @param minSdkVersion - the minimim sdk version to use
- * @returns <code>true</code> on success, false otherwise
- */
- public boolean setMinSdkVersion(String minSdkVersion) {
- Element usesSdkElement = null;
- NodeList nodeList = mDoc.getElementsByTagName(AndroidManifest.NODE_USES_SDK);
- if (nodeList.getLength() > 0) {
- usesSdkElement = (Element) nodeList.item(0);
- } else {
- usesSdkElement = mDoc.createElement(AndroidManifest.NODE_USES_SDK);
- mDoc.getDocumentElement().appendChild(usesSdkElement);
- }
- Attr minSdkAttr = mDoc.createAttributeNS(SdkConstants.NS_RESOURCES,
- AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION);
- String prefix = mDoc.lookupPrefix(SdkConstants.NS_RESOURCES);
- minSdkAttr.setPrefix(prefix);
- minSdkAttr.setValue(minSdkVersion);
- usesSdkElement.setAttributeNodeNS(minSdkAttr);
- return saveXmlToFile();
- }
-
- private boolean saveXmlToFile() {
- try {
- // Prepare the DOM document for writing
- Source source = new DOMSource(mDoc);
-
- // Prepare the output file
- File file = new File(mOsManifestFilePath);
- Result result = new StreamResult(file);
-
- // Write the DOM document to the file
- Transformer xformer = TransformerFactory.newInstance().newTransformer();
- xformer.transform(source, result);
- } catch (TransformerConfigurationException e) {
- sLogger.log(Level.SEVERE, "Failed to write xml file", e);
- return false;
- } catch (TransformerException e) {
- sLogger.log(Level.SEVERE, "Failed to write xml file", e);
- return false;
- }
- return true;
- }
-
- /**
- * Parses the manifest file, and collects data.
- *
- * @param osManifestFilePath The OS path of the manifest file to parse.
- * @return an {@link AndroidManifestHelper} or null if parsing failed
- */
- public static AndroidManifestWriter parse(String osManifestFilePath) {
- try {
- DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
- docFactory.setNamespaceAware(true);
- DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
- Document doc = docBuilder.parse(osManifestFilePath);
- return new AndroidManifestWriter(doc, osManifestFilePath);
- } catch (ParserConfigurationException e) {
- sLogger.log(Level.SEVERE, "Error parsing file", e);
- return null;
- } catch (SAXException e) {
- sLogger.log(Level.SEVERE, "Error parsing file", e);
- return null;
- } catch (IOException e) {
- sLogger.log(Level.SEVERE, "Error parsing file", e);
- return null;
- }
- }
-}
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
deleted file mode 100644
index 3fb705dfb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (C) 2008 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.tests.functests.sampleProjects;
-
-import com.android.SdkConstants;
-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.SdkLoadingTestCase;
-import com.android.sdklib.IAndroidTarget;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Display;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Test case that verifies all SDK sample projects can be imported, and built in
- * Eclipse.
- * <p/>
- * TODO: add support for deploying apps onto emulator and verifying successful
- * execution there
- *
- */
-public class SampleProjectTest extends SdkLoadingTestCase {
-
- private static final Logger sLogger = Logger.getLogger(SampleProjectTest.class.getName());
-
- /**
- * Finds all samples projects in set SDK and verify they can be built in Eclipse.
- * <p/>
- * TODO: add install and run on emulator test
- * @throws CoreException
- */
- public void testSamples() throws CoreException {
- // TODO: For reporting purposes, it would be better if a separate test success or failure
- // could be reported for each sample
- IAndroidTarget[] targets = getSdk().getTargets();
- for (IAndroidTarget target : targets) {
- doTestSamplesForTarget(target);
- }
- }
-
- private void doTestSamplesForTarget(IAndroidTarget target) throws CoreException {
- String path = target.getPath(IAndroidTarget.SAMPLES);
- File samples = new File(path);
- if (samples.isDirectory()) {
- File[] files = samples.listFiles();
- for (File file : files) {
- if (file.isDirectory()) {
- doTestSampleProject(file.getName(), file.getAbsolutePath(), target);
- }
- }
- }
- }
-
- /**
- * Tests the sample project with the given name
- *
- * @param target - SDK target of project
- * @param name - name of sample project to test
- * @param path - absolute file system path
- * @throws CoreException
- */
- private void doTestSampleProject(String name, String path, IAndroidTarget target)
- throws CoreException {
- IProject iproject = null;
- try {
- sLogger.log(Level.INFO, String.format("Testing sample %s for target %s", name,
- target.getName()));
-
- prepareProject(path, target);
-
- IRunnableContext context = new IRunnableContext() {
- @Override
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
- throws InvocationTargetException, InterruptedException {
- runnable.run(new NullProgressMonitor());
- }
- };
- NewProjectWizardState state = new NewProjectWizardState(Mode.SAMPLE);
- state.projectName = name;
- state.target = target;
- state.packageName = "com.android.samples";
- state.activityName = name;
- state.applicationName = name;
- state.chosenSample = new File(path);
- state.useDefaultLocation = false;
- state.createActivity = false;
-
- NewProjectCreator creator = new NewProjectCreator(state, context);
- creator.createAndroidProjects();
- iproject = validateProjectExists(name);
- validateNoProblems(iproject);
- }
- catch (CoreException e) {
- sLogger.log(Level.SEVERE,
- String.format("Unexpected exception when creating sample project %s " +
- "for target %s", name, target.getName()));
- throw e;
- } finally {
- if (iproject != null) {
- iproject.delete(false, true, new NullProgressMonitor());
- }
- }
- }
-
- private void prepareProject(String path, IAndroidTarget target) {
- if (target.getVersion().isPreview()) {
- // need to explicitly set preview's version in manifest for project to compile
- final String manifestPath = path + File.separatorChar +
- SdkConstants.FN_ANDROID_MANIFEST_XML;
- AndroidManifestWriter manifestWriter =
- AndroidManifestWriter.parse(manifestPath);
- assertNotNull(String.format("could not read manifest %s", manifestPath),
- manifestWriter);
- assertTrue(manifestWriter.setMinSdkVersion(target.getVersion().getApiString()));
- }
- }
-
- private IProject validateProjectExists(String name) {
- IProject iproject = getIProject(name);
- assertTrue(String.format("%s project not created", name), iproject.exists());
- assertTrue(String.format("%s project not opened", name), iproject.isOpen());
- return iproject;
- }
-
- private IProject getIProject(String name) {
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(name);
- return iproject;
- }
-
- private void validateNoProblems(IProject iproject) throws CoreException {
- waitForBuild(iproject);
-
- boolean hasErrors = false;
- StringBuilder failureBuilder = new StringBuilder(String.format("%s project has errors:",
- iproject.getName()));
- IMarker[] markers = iproject.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
- if (markers != null && markers.length > 0) {
- // the project has marker(s). even though they are "problem" we
- // don't know their severity. so we loop on them and figure if they
- // are warnings or errors
- for (IMarker m : markers) {
- int s = m.getAttribute(IMarker.SEVERITY, -1);
- if (s == IMarker.SEVERITY_ERROR) {
- hasErrors = true;
- failureBuilder.append("\n");
- failureBuilder.append(m.getAttribute(IMarker.MESSAGE, ""));
- }
- }
- }
- failureBuilder.append("Project location: " + AdtUtils.getAbsolutePath(iproject));
- assertFalse(failureBuilder.toString(), hasErrors);
- }
-
- /**
- * Waits for build to complete.
- *
- * @param iproject
- */
- private void waitForBuild(final IProject iproject) {
-
- final BuiltProjectDeltaVisitor deltaVisitor = new BuiltProjectDeltaVisitor(iproject);
- IResourceChangeListener newBuildListener = new IResourceChangeListener() {
-
- @Override
- public void resourceChanged(IResourceChangeEvent event) {
- try {
- event.getDelta().accept(deltaVisitor);
- }
- catch (CoreException e) {
- fail();
- }
- }
-
- };
- iproject.getWorkspace().addResourceChangeListener(newBuildListener,
- IResourceChangeEvent.POST_BUILD);
-
- // poll build listener to determine when build is done
- // loop max of 1200 times * 50 ms = 60 seconds
- final int maxWait = 1200;
- for (int i=0; i < maxWait; i++) {
- if (deltaVisitor.isProjectBuilt()) {
- return;
- }
- try {
- Thread.sleep(50);
- }
- catch (InterruptedException e) {
- // ignore
- }
- if (Display.getCurrent() != null) {
- Display.getCurrent().readAndDispatch();
- }
- }
-
- sLogger.log(Level.SEVERE, "expected build event never happened?");
- fail(String.format("Expected build event never happened for %s", iproject.getName()));
- }
-
- /**
- * Scans a given IResourceDelta looking for a "build event" change for given IProject
- *
- */
- private class BuiltProjectDeltaVisitor implements IResourceDeltaVisitor {
-
- private IProject mIProject;
- private boolean mIsBuilt;
-
- public BuiltProjectDeltaVisitor(IProject iproject) {
- mIProject = iproject;
- mIsBuilt = false;
- }
-
- @Override
- public boolean visit(IResourceDelta delta) {
- if (mIProject.equals(delta.getResource())) {
- setBuilt(true);
- return false;
- }
- return true;
- }
-
- private synchronized void setBuilt(boolean b) {
- mIsBuilt = b;
- }
-
- public synchronized boolean isProjectBuilt() {
- return mIsBuilt;
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/test.xml b/eclipse/plugins/com.android.ide.eclipse.tests/test.xml
deleted file mode 100644
index e5519b002..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/test.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- test launcher file for Android Eclipse tests -->
-<project name="testsuite" default="run" basedir=".">
- <!--The following properties should be passed into this script, set to some default value for now -->
- <property name="eclipse.home" value="/opt/eclipse" />
- <property name="sdk_home" value="/tmp/sdk" />
- <property name="eclipse_test" value="${eclipse.home}/plugins/org.eclipse.test_3.2.0" />
-
- <!-- eclipse scripts use an annoying mixture of eclipse-home and eclipse.home -->
- <!-- lets define both...-->
- <property name="eclipse-home" value="${eclipse.home}" />
- <property name="test-folder" value="${eclipse.home}/test_folder" />
-
- <!-- sets the properties eclipse.home, and library-file -->
- <property name="plugin-name" value="com.android.ide.eclipse.tests" />
- <property name="library-file" value="${eclipse_test}/library.xml" />
-
- <!-- location of adt preference file (within workspace) -->
- <property name="prefs_path" value="${test-folder}/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.android.ide.eclipse.adt.prefs" />
- <!-- location of pref template file relative to this file -->
-
- <property name="prefs_template" value="prefs.template" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. -->
- <target name="init">
- <tstamp />
- <echo message="eclipse.home: ${eclipse.home}" />
- <echo message="libfile: ${library-file}" />
-
- <!-- delete test eclipse workspace -->
- <delete dir="${test-folder}" quiet="true" />
-
- <!-- delete test results dir -->
- <delete dir="${eclipse.home}/results" quiet="true" />
-
- <!-- Copy a preference file into the test workspace. -->
- <!-- This is done to ensure Android SDK preference is set on startup -->
- <copy file="${prefs_template}" tofile="${prefs_path}" />
- <!-- replace sdk path placeholder token with actual sdk path -->
- <replace file="${prefs_path}" token="sdk_home" value="${sdk_home}" />
-
- <!-- if this is on windows, escape the drive and file separators -->
- <replace file="${prefs_path}" token="\" value="\\" />
- <replace file="${prefs_path}" token=":" value="\:" />
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <!-- launch as ui-test ie as a test which needs Eclipse workbench -->
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse.home}">
- <property name="data-dir" value="${test-folder}" />
- <property name="plugin-name" value="${plugin-name}" />
- <property name="classname" value="com.android.ide.eclipse.tests.AllTests" />
- <!-- pass extra vm arg to set sdk_home env and test_data env variable -->
- <property name="extraVMargs" value="-Dtest_data=${test_data}" />
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse.home}/results">
- <property name="includes" value="com*.xml" />
- <property name="output-file" value="${plugin-name}.xml" />
- </ant>
- </target>
-</project>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittest.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittest.xml
deleted file mode 100644
index 83e00ec19..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittest.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- test launcher file for Android Eclipse unit tests -->
-<project name="testsuite" default="run" basedir=".">
- <!--The following properties should be passed into this script, set to some default value for now -->
- <property name="eclipse.home" value="/opt/eclipse" />
- <property name="eclipse_test" value="${eclipse.home}/plugins/org.eclipse.test_3.2.0" />
-
- <!-- eclipse scripts use an annoying mixture of eclipse-home and eclipse.home -->
- <!-- lets define both...-->
- <property name="eclipse-home" value="${eclipse.home}" />
- <property name="test-folder" value="${eclipse.home}/unittest_ws" />
-
- <!-- sets the properties eclipse.home, and library-file -->
- <property name="plugin-name" value="com.android.ide.eclipse.tests" />
- <property name="library-file" value="${eclipse_test}/library.xml" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. -->
- <target name="init">
- <ant antfile="test.xml" target="init">
- <property name="test-folder" value="${test-folder}" />
- </ant>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <!-- need to launch as ui-test since all ADT plugins depend on ui-->
- <!-- otherwise other plugins will not load -->
- <ant target="ui-test" antfile="${library-file}" dir="${eclipse.home}">
- <property name="data-dir" value="${test-folder}" />
- <property name="plugin-name" value="${plugin-name}" />
- <property name="classname" value="com.android.ide.eclipse.tests.UnitTests" />
- <!-- pass extra vm arg to set test_data env variable -->
- <property name="extraVMargs" value="-Dtest_data=${test_data}" />
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse.home}/results">
- <property name="includes" value="com*.xml" />
- <property name="output-file" value="${plugin-name}.xml" />
- </ant>
- </target>
-</project>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/PointTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/PointTest.java
deleted file mode 100755
index 54b6ff64c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/PointTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.api;
-
-import com.android.ide.common.api.Point;
-
-import junit.framework.TestCase;
-
-public class PointTest extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- public final void testPointIntInt() {
- Point p = new Point(1, 2);
- assertEquals(1, p.x);
- assertEquals(2, p.y);
-
- p = new Point(-3, -4);
- assertEquals(-3, p.x);
- assertEquals(-4, p.y);
- }
-
- public final void testSet() {
- Point p = new Point(1, 2);
- assertEquals(1, p.x);
- assertEquals(2, p.y);
-
- p.set(-3, -4);
- assertEquals(-3, p.x);
- assertEquals(-4, p.y);
- }
-
- public final void testPointPoint() {
- Point p = new Point(1, 2);
- Point p2 = new Point(p);
-
- assertNotSame(p, p2);
- assertEquals(p, p2);
- }
-
- public final void testPointPoint_Null() {
- // Constructing a point with null throws an NPE
- try {
- new Point(null);
- } catch (NullPointerException ignore) {
- return; // success
- }
-
- fail("new Point(null) failed to throew NullPointerException");
- }
-
- public final void testCopy() {
- Point p = new Point(1, 2);
- Point p2 = p.copy();
-
- assertNotSame(p, p2);
- assertEquals(p, p2);
- }
-
- public final void testOffsetBy() {
- Point p = new Point(1, 2);
- Point p2 = p.offsetBy(3, 4);
-
- assertSame(p, p2);
- assertEquals(1+3, p.x);
- assertEquals(2+4, p.y);
- }
-
- public final void testEquals_Null() {
- Point p = new Point(1, 2);
- assertFalse(p.equals(null));
- }
-
- public final void testEquals_UnknownObject() {
- Point p = new Point(1, 2);
- assertFalse(p.equals(new Object()));
- }
-
- public final void testEquals_Point() {
- Point p = new Point(1, 2);
- Point p1 = new Point(1, 2);
- Point p2 = new Point(-3, -4);
-
- assertNotSame(p1, p);
- assertTrue(p.equals(p1));
-
- assertFalse(p.equals(p2));
- }
-
- public final void testHashCode() {
- Point p = new Point(1, 2);
- Point p1 = new Point(1, 2);
- Point p2 = new Point(-3, -4);
-
- assertNotSame(p1, p);
- assertEquals(p1.hashCode(), p.hashCode());
-
- assertFalse(p2.hashCode() == p.hashCode());
- }
-
- public final void testToString() {
- Point p = new Point(1, 2);
- assertEquals("Point [1x2]", p.toString());
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java
deleted file mode 100755
index 2f2c59a75..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.api;
-
-import junit.framework.TestCase;
-
-public class RectTest extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- public final void testRect() {
- Rect r = new Rect();
- assertEquals(0, r.x);
- assertEquals(0, r.y);
- assertEquals(0, r.w);
- assertEquals(0, r.h);
- }
-
- public final void testRectIntIntIntInt() {
- Rect r = new Rect(1, 2, 3, 4);
- assertEquals(1, r.x);
- assertEquals(2, r.y);
- assertEquals(3, r.w);
- assertEquals(4, r.h);
- }
-
- public final void testRectRect() {
- Rect r = new Rect(1, 2, 3, 4);
- Rect r2 = new Rect(r);
-
- assertNotSame(r2, r);
- assertEquals(r2, r);
- }
-
- public final void testSetIntIntIntInt() {
- Rect r = new Rect(1, 2, 3, 4);
- Rect r2 = r.set(3, 4, 20, 30);
-
- assertSame(r2, r);
- assertEquals(3, r2.x);
- assertEquals(4, r2.y);
- assertEquals(20, r2.w);
- assertEquals(30, r2.h);
- }
-
- public final void testSetRect() {
- Rect r = new Rect(1, 2, 3, 4);
- Rect r2 = new Rect(3, 4, 20, 30);
- Rect r3 = r.set(r2);
-
- assertSame(r3, r);
- assertNotSame(r3, r2);
- assertEquals(3, r.x);
- assertEquals(4, r.y);
- assertEquals(20, r.w);
- assertEquals(30, r.h);
- }
-
- public final void testCopy() {
- Rect r = new Rect(1, 2, 3, 4);
- Rect r2 = r.copy();
-
- assertNotSame(r2, r);
- assertEquals(r2, r);
- }
-
- public final void testIsValid() {
- Rect r = new Rect();
- assertFalse(r.isValid());
-
- r = new Rect(1, 2, 3, 4);
- assertTrue(r.isValid());
-
- // Rectangles must have a width > 0 to be valid
- r = new Rect(1, 2, 0, 4);
- assertFalse(r.isValid());
- r = new Rect(1, 2, -5, 4);
- assertFalse(r.isValid());
-
- // Rectangles must have a height > 0 to be valid
- r = new Rect(1, 2, 3, 0);
- assertFalse(r.isValid());
- r = new Rect(1, 2, 3, -5);
- assertFalse(r.isValid());
-
- r = new Rect(1, 2, 0, 0);
- assertFalse(r.isValid());
- r = new Rect(1, 2, -20, -5);
- assertFalse(r.isValid());
- }
-
- public final void testContainsIntInt() {
- Rect r = new Rect(3, 4, 20, 30);
-
- assertTrue(r.contains(3, 4));
- assertTrue(r.contains(3+19, 4));
- assertTrue(r.contains(3+19, 4+29));
- assertTrue(r.contains(3, 4+29));
-
- assertFalse(r.contains(3-1, 4));
- assertFalse(r.contains(3, 4-1));
- assertFalse(r.contains(3-1, 4-1));
-
- assertFalse(r.contains(3+20, 4));
- assertFalse(r.contains(3+20, 4+30));
- assertFalse(r.contains(3, 4+30));
- }
-
- public final void testContainsIntInt_Invalid() {
- // Invalid rects always return false
- Rect r = new Rect(3, 4, -20, -30);
- assertFalse(r.contains(3, 4));
- }
-
- public final void testContainsPoint_Null() {
- // contains(null) returns false rather than an NPE
- Rect r = new Rect(3, 4, -20, -30);
- assertFalse(r.contains((Point) null));
- }
-
- public final void testContainsRect_Null() {
- // contains(null) returns false rather than an NPE
- Rect r = new Rect(3, 4, -20, -30);
- assertFalse(r.contains((Rect) null));
- }
-
- public final void testContainsPoint() {
- Rect r = new Rect(3, 4, 20, 30);
-
- assertTrue(r.contains(new Point(3, 4)));
- assertTrue(r.contains(new Point(3+19, 4)));
- assertTrue(r.contains(new Point(3+19, 4+29)));
- assertTrue(r.contains(new Point(3, 4+29)));
-
- assertFalse(r.contains(new Point(3-1, 4)));
- assertFalse(r.contains(new Point(3, 4-1)));
- assertFalse(r.contains(new Point(3-1, 4-1)));
-
- assertFalse(r.contains(new Point(3+20, 4)));
- assertFalse(r.contains(new Point(3+20, 4+30)));
- assertFalse(r.contains(new Point(3, 4+30)));
- }
-
- public final void testContainsRect() {
- Rect r = new Rect(3, 4, 20, 30);
-
- assertTrue(r.contains(new Rect(3, 4, 5, 10)));
- assertFalse(r.contains(new Rect(3 - 1, 4, 5, 10)));
- }
-
- public final void testIntersects() {
- Rect r1 = new Rect(0, 0, 10, 10);
- Rect r2 = new Rect(1, 1, 5, 5);
- Rect r3 = new Rect(10, 0, 1, 1);
- Rect r4 = new Rect(5, 5, 10, 10);
- Rect r5 = new Rect(-1, 0, 1, 1);
- Rect r6 = new Rect(0, 10, 1, 1);
-
- assertTrue(r1.intersects(r2));
- assertTrue(r2.intersects(r1));
- assertTrue(r1.intersects(r4));
- assertFalse(r1.intersects(r3));
- assertFalse(r1.intersects(r5));
- assertFalse(r1.intersects(r6));
- }
-
- public final void testMoveTo() {
- Rect r = new Rect(3, 4, 20, 30);
- Rect r2 = r.moveTo(100, 200);
-
- assertSame(r2, r);
- assertEquals(100, r.x);
- assertEquals(200, r.y);
- assertEquals(20, r.w);
- assertEquals(30, r.h);
- }
-
- public final void testOffsetBy() {
- Rect r = new Rect(3, 4, 20, 30);
- Rect r2 = r.offsetBy(100, 200);
-
- assertSame(r2, r);
- assertEquals(103, r.x);
- assertEquals(204, r.y);
- assertEquals(20, r.w);
- assertEquals(30, r.h);
- }
-
- public final void testGetCenter() {
- Rect r = new Rect(3, 4, 20, 30);
- Point p = r.getCenter();
-
- assertEquals(3+20/2, p.x);
- assertEquals(4+30/2, p.y);
- }
-
- public final void testGetTopLeft() {
- Rect r = new Rect(3, 4, 20, 30);
- Point p = r.getTopLeft();
-
- assertEquals(3, p.x);
- assertEquals(4, p.y);
- }
-
- public final void testGetBottomLeft() {
- Rect r = new Rect(3, 4, 20, 30);
- Point p = r.getBottomLeft();
-
- assertEquals(3, p.x);
- assertEquals(4+30, p.y);
- }
-
- public final void testGetTopRight() {
- Rect r = new Rect(3, 4, 20, 30);
- Point p = r.getTopRight();
-
- assertEquals(3+20, p.x);
- assertEquals(4, p.y);
- }
-
- public final void testGetBottomRight() {
- Rect r = new Rect(3, 4, 20, 30);
- Point p = r.getBottomRight();
-
- assertEquals(3+20, p.x);
- assertEquals(4+30, p.y);
- }
-
- public final void testToString() {
- Rect r = new Rect(3, 4, 20, 30);
-
- assertEquals("Rect [(3,4)-(23,34): 20x30]", r.toString());
- }
-
- public final void testEqualsObject() {
- Rect r = new Rect(3, 4, 20, 30);
-
- assertFalse(r.equals(null));
- assertFalse(r.equals(new Object()));
- assertTrue(r.equals(new Rect(3, 4, 20, 30)));
- }
-
- public final void testEqualsObject_Invalid() {
- Rect r = new Rect(3, 4, 20, 30);
- assertTrue(r.isValid());
-
- Rect i1 = new Rect(3, 4, 0, 0);
- assertFalse(i1.isValid());
- Rect i2 = new Rect(10, 20, 0, 0);
- assertFalse(i2.isValid());
-
- // valid rects can't be equal to invalid rects
- assertFalse(r.equals(i1));
- assertFalse(r.equals(i2));
-
- // invalid rects are equal to each other whatever their content is
- assertEquals(i2, i1);
- }
-
- public final void testHashCode() {
- Rect r = new Rect(1, 2, 3, 4);
- Rect r1 = new Rect(3, 4, 20, 30);
- Rect r2 = new Rect(3, 4, 20, 30);
-
- assertFalse(r1.hashCode() == r.hashCode());
- assertEquals(r2.hashCode(), r1.hashCode());
- }
-
-
- public final void testCenter() {
- Rect r = new Rect(10, 20, 30, 40);
- Point center = r.center();
- assertEquals(25, center.x);
- assertEquals(40, center.y);
- assertEquals(25, r.centerX());
- assertEquals(40, r.centerY());
- }
-
- public final void testX2Y2() {
- Rect r = new Rect(1, 2, 3, 4);
- assertEquals(4, r.x2());
- assertEquals(6, r.y2());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java
deleted file mode 100644
index 1a14bdda4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import static com.android.SdkConstants.ANDROID_URI;
-
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Point;
-import com.android.ide.common.api.Rect;
-
-/** Test the {@link AbsoluteLayoutRule} */
-public class AbsoluteLayoutRuleTest extends LayoutTestBase {
- // Utility for other tests
- protected INode dragInto(Rect dragBounds, Point dragPoint, int insertIndex, int currentIndex,
- String... graphicsFragments) {
- INode layout = TestNode.create("android.widget.AbsoluteLayout").id("@+id/AbsoluteLayout01")
- .bounds(new Rect(0, 0, 240, 480)).add(
- TestNode.create("android.widget.Button").id("@+id/Button01").bounds(
- new Rect(0, 0, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button02").bounds(
- new Rect(0, 100, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button03").bounds(
- new Rect(0, 200, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button04").bounds(
- new Rect(0, 300, 100, 80)));
-
- return super.dragInto(new AbsoluteLayoutRule(), layout, dragBounds, dragPoint, null,
- insertIndex, currentIndex, graphicsFragments);
- }
-
- public void testDragMiddle() {
- INode inserted = dragInto(
- // Bounds of the dragged item
- new Rect(0, 0, 105, 80),
- // Drag point
- new Point(30, -10),
- // Expected insert location: We just append in absolute layout
- 4,
- // Not dragging one of the existing children
- -1,
-
-
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop preview
- "useStyle(DROP_PREVIEW), drawRect(30,-10,135,70)");
-
- assertEquals("30dp", inserted.getStringAttr(ANDROID_URI, "layout_x"));
- assertEquals("-10dp", inserted.getStringAttr(ANDROID_URI, "layout_y"));
-
- // Without drag bounds we should just draw guide lines instead
- inserted = dragInto(new Rect(0, 0, 0, 0), new Point(30, -10), 4, -1,
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
- // Guideline
- "useStyle(GUIDELINE), drawLine(30,0,30,480), drawLine(0,-10,240,-10)",
- // Drop preview
- "useStyle(DROP_PREVIEW), drawLine(30,-10,240,-10), drawLine(30,-10,30,480)");
- assertEquals("30dp", inserted.getStringAttr(ANDROID_URI, "layout_x"));
- assertEquals("-10dp", inserted.getStringAttr(ANDROID_URI, "layout_y"));
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java
deleted file mode 100644
index d176fe7d1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutRuleTest.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-
-import com.android.ide.common.api.IDragElement;
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Rect;
-import com.android.ide.common.layout.BaseLayoutRule.AttributeFilter;
-import com.android.utils.Pair;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-// TODO: Check assertions
-// TODO: Check equals() but not == strings by using new String("") to prevent interning
-// TODO: Rename BaseLayout to BaseLayoutRule, and tests too of course
-
-public class BaseLayoutRuleTest extends LayoutTestBase {
-
- /** Provides test data used by other test cases */
- private IDragElement[] createSampleElements() {
- IDragElement[] elements = TestDragElement.create(TestDragElement.create(
- "android.widget.Button", new Rect(0, 0, 100, 80)).id("@+id/Button01"),
- TestDragElement.create("android.widget.LinearLayout", new Rect(0, 80, 100, 280))
- .id("@+id/LinearLayout01").add(
- TestDragElement.create("android.widget.Button",
- new Rect(0, 80, 100, 80)).id("@+id/Button011"),
- TestDragElement.create("android.widget.Button",
- new Rect(0, 180, 100, 80)).id("@+id/Button012")),
- TestDragElement.create("android.widget.Button", new Rect(100, 0, 100, 80)).id(
- "@+id/Button02"));
- return elements;
- }
-
- /** Test {@link BaseLayoutRule#collectIds}: Check that basic lookup of id works */
- public final void testCollectIds1() {
- IDragElement[] elements = TestDragElement.create(TestDragElement.create(
- "android.widget.Button", new Rect(0, 0, 100, 80)).id("@+id/Button01"));
- Map<String, Pair<String, String>> idMap = new HashMap<String, Pair<String, String>>();
- Map<String, Pair<String, String>> ids = new BaseLayoutRule().collectIds(idMap, elements);
- assertEquals(1, ids.size());
- assertEquals("@+id/Button01", ids.keySet().iterator().next());
- }
-
- /**
- * Test {@link BaseLayoutRule#collectIds}: Check that with the wrong URI we
- * don't pick up the ID
- */
- public final void testCollectIds2() {
- IDragElement[] elements = TestDragElement.create(TestDragElement.create(
- "android.widget.Button", new Rect(0, 0, 100, 80)).set("myuri", ATTR_ID,
- "@+id/Button01"));
-
- Map<String, Pair<String, String>> idMap = new HashMap<String, Pair<String, String>>();
- Map<String, Pair<String, String>> ids = new BaseLayoutRule().collectIds(idMap, elements);
- assertEquals(0, ids.size());
- }
-
- /**
- * Test {@link BaseLayoutRule#normalizeId(String)}
- */
- public final void testNormalizeId() {
- assertEquals("foo", new BaseLayoutRule().normalizeId("foo"));
- assertEquals("@+id/name", new BaseLayoutRule().normalizeId("@id/name"));
- assertEquals("@+id/name", new BaseLayoutRule().normalizeId("@+id/name"));
- }
-
- /**
- * Test {@link BaseLayoutRule#collectExistingIds}
- */
- public final void testCollectExistingIds1() {
- Set<String> existing = new HashSet<String>();
- INode node = TestNode.create("android.widget.Button").id("@+id/Button012").add(
- TestNode.create("android.widget.Button").id("@+id/Button2"));
-
- new BaseLayoutRule().collectExistingIds(node, existing);
-
- assertEquals(2, existing.size());
- assertContainsSame(Arrays.asList("@+id/Button2", "@+id/Button012"), existing);
- }
-
- /**
- * Test {@link BaseLayoutRule#collectIds}: Check that with multiple elements and
- * some children we still pick up all the right id's
- */
- public final void testCollectIds3() {
- Map<String, Pair<String, String>> idMap = new HashMap<String, Pair<String, String>>();
-
- IDragElement[] elements = createSampleElements();
- Map<String, Pair<String, String>> ids = new BaseLayoutRule().collectIds(idMap, elements);
- assertEquals(5, ids.size());
- assertContainsSame(Arrays.asList("@+id/Button01", "@+id/Button02", "@+id/Button011",
- "@+id/Button012", "@+id/LinearLayout01"), ids.keySet());
-
- // Make sure the Pair has the right stuff too;
- // (having the id again in the pair seems redundant; see if I really
- // need it in the implementation)
- assertEquals(Pair.of("@+id/LinearLayout01", "android.widget.LinearLayout"), ids
- .get("@+id/LinearLayout01"));
- }
-
- /**
- * Test {@link BaseLayoutRule#remapIds}: Ensure that it identifies a conflict
- */
- public final void testRemapIds1() {
- Map<String, Pair<String, String>> idMap = new HashMap<String, Pair<String, String>>();
- BaseLayoutRule baseLayout = new BaseLayoutRule();
- IDragElement[] elements = createSampleElements();
- baseLayout.collectIds(idMap, elements);
- INode node = TestNode.create("android.widget.Button").id("@+id/Button012").add(
- TestNode.create("android.widget.Button").id("@+id/Button2"));
-
- assertEquals(5, idMap.size());
- Map<String, Pair<String, String>> remapped = baseLayout.remapIds(node, idMap);
- // 4 original from the sample elements, plus overlap with one
- // (Button012) - one new
- // button added in
- assertEquals(6, remapped.size());
-
- // TODO: I'm a little confused about what exactly this method should do;
- // check with Raphael.
- }
-
-
- /**
- * Test {@link BaseLayoutRule#getDropIdMap}
- */
- public final void testGetDropIdMap() {
- BaseLayoutRule baseLayout = new BaseLayoutRule();
- IDragElement[] elements = createSampleElements();
- INode node = TestNode.create("android.widget.Button").id("@+id/Button012").add(
- TestNode.create("android.widget.Button").id("@+id/Button2"));
-
- Map<String, Pair<String, String>> idMap = baseLayout.getDropIdMap(node, elements, true);
- assertContainsSame(Arrays.asList("@+id/Button01", "@+id/Button012", "@+id/Button011",
- "@id/Button012", "@+id/Button02", "@+id/LinearLayout01"), idMap
- .keySet());
-
- // TODO: I'm a little confused about what exactly this method should do;
- // check with Raphael.
- }
-
- public final void testAddAttributes1() {
- BaseLayoutRule layout = new BaseLayoutRule();
-
- // First try with no filter
- IDragElement oldElement = TestDragElement.create("a.w.B").id("@+id/foo");
- INode newNode = TestNode.create("a.w.B").id("@+id/foo").set("u", "key", "value").set("u",
- "nothidden", "nothiddenvalue");
- ;
- AttributeFilter filter = null;
- // No references in this test case
- Map<String, Pair<String, String>> idMap = null;
-
- layout.addAttributes(newNode, oldElement, idMap, filter);
- assertEquals("value", newNode.getStringAttr("u", "key"));
- assertEquals("nothiddenvalue", newNode.getStringAttr("u", "nothidden"));
- }
-
- public final void testAddAttributes2() {
- // Test filtering
- BaseLayoutRule layout = new BaseLayoutRule();
-
- // First try with no filter
- IDragElement oldElement = TestDragElement.create("a.w.B").id("@+id/foo");
- INode newNode = TestNode.create("a.w.B").id("@+id/foo").set("u", "key", "value").set("u",
- "hidden", "hiddenvalue");
- AttributeFilter filter = new AttributeFilter() {
-
- @Override
- public String replace(String attributeUri, String attributeName,
- String attributeValue) {
- if (attributeName.equals("hidden")) {
- return null;
- }
-
- return attributeValue;
- }
- };
- // No references in this test case
- Map<String, Pair<String, String>> idMap = null;
-
- layout.addAttributes(newNode, oldElement, idMap, filter);
- assertEquals("value", newNode.getStringAttr("u", "key"));
- }
-
- public final void testFindNewId() {
- BaseLayoutRule baseLayout = new BaseLayoutRule();
- Set<String> existing = new HashSet<String>();
- assertEquals("@+id/Widget01", baseLayout.findNewId("a.w.Widget", existing));
-
- existing.add("@+id/Widget01");
- assertEquals("@+id/Widget02", baseLayout.findNewId("a.w.Widget", existing));
-
- existing.add("@+id/Widget02");
- assertEquals("@+id/Widget03", baseLayout.findNewId("a.w.Widget", existing));
-
- existing.remove("@+id/Widget02");
- assertEquals("@+id/Widget02", baseLayout.findNewId("a.w.Widget", existing));
- }
-
- public final void testDefaultAttributeFilter() {
- assertEquals("true", BaseLayoutRule.DEFAULT_ATTR_FILTER.replace("myuri", "layout_alignRight",
- "true"));
- assertEquals(null, BaseLayoutRule.DEFAULT_ATTR_FILTER.replace(ANDROID_URI,
- "layout_alignRight", "true"));
- assertEquals("true", BaseLayoutRule.DEFAULT_ATTR_FILTER.replace(ANDROID_URI,
- "myproperty", "true"));
- }
-
- public final void testAddInnerElements() {
- IDragElement oldElement = TestDragElement.create("root").add(
- TestDragElement.create("a.w.B").id("@+id/child1")
- .set("uri", "childprop1", "value1"),
- TestDragElement.create("a.w.B").id("@+id/child2").set("uri", "childprop2a",
- "value2a").set("uri", "childprop2b", "value2b"));
- INode newNode = TestNode.create("a.w.B").id("@+id/foo");
- Map<String, Pair<String, String>> idMap = new HashMap<String, Pair<String, String>>();
- BaseLayoutRule layout = new BaseLayoutRule();
- layout.addInnerElements(newNode, oldElement, idMap);
- assertEquals(2, newNode.getChildren().length);
-
- assertEquals("value2b", newNode.getChildren()[1].getStringAttr("uri", "childprop2b"));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseViewRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseViewRuleTest.java
deleted file mode 100644
index 6d46b1efc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseViewRuleTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
-public class BaseViewRuleTest extends TestCase {
-
- public final void testGetAttributeDisplayName() {
- assertEquals(null, BaseViewRule.getAttributeDisplayName(null));
- assertEquals("", BaseViewRule.getAttributeDisplayName(""));
- assertEquals("Foo", BaseViewRule.getAttributeDisplayName("foo"));
- assertEquals("FooBar", BaseViewRule.getAttributeDisplayName("fooBar"));
- assertEquals("Foo Bar", BaseViewRule.getAttributeDisplayName("foo_bar"));
- // TBD: Should we also handle CamelCase properties?
- // assertEquals("Foo Bar", BaseViewRule.getAttributeDisplayName("fooBar"));
- }
-
- public final void testJoin() {
- assertEquals("foo", BaseViewRule.join('|', Arrays.asList("foo")));
- assertEquals("", BaseViewRule.join('|', Collections.<String>emptyList()));
- assertEquals("foo,bar", BaseViewRule.join(',', Arrays.asList("foo", "bar")));
- assertEquals("foo|bar", BaseViewRule.join('|', Arrays.asList("foo", "bar")));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java
deleted file mode 100644
index 4a60566d9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Point;
-import com.android.ide.common.api.Rect;
-
-/** Test the {@link FrameLayoutRule} */
-public class FrameLayoutRuleTest extends LayoutTestBase {
- // Utility for other tests
- protected void dragInto(Rect dragBounds, Point dragPoint, int insertIndex, int currentIndex,
- String... graphicsFragments) {
- INode layout = TestNode.create("android.widget.FrameLayout").id("@+id/FrameLayout01")
- .bounds(new Rect(0, 0, 240, 480)).add(
- TestNode.create("android.widget.Button").id("@+id/Button01").bounds(
- new Rect(0, 0, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button02").bounds(
- new Rect(0, 100, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button03").bounds(
- new Rect(0, 200, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button04").bounds(
- new Rect(0, 300, 100, 80)));
-
- super.dragInto(new FrameLayoutRule(), layout, dragBounds, dragPoint, null,
- insertIndex, currentIndex, graphicsFragments);
- }
-
- public void testDragMiddle() {
- dragInto(
- // Bounds of the dragged item
- new Rect(0, 0, 105, 80),
- // Drag point
- new Point(30, -10),
- // Expected insert location: We just append in absolute layout
- 4,
- // Not dragging one of the existing children
- -1,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop Preview
- "useStyle(DROP_PREVIEW), drawRect(0,0,105,80)");
- // Without drag bounds we should just draw guide lines instead
- dragInto(new Rect(0, 0, 0, 0), new Point(30, -10), 4, -1,
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
- "useStyle(DROP_PREVIEW), drawLine(1,0,1,480), drawLine(0,1,240,1)");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GravityHelperTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GravityHelperTest.java
deleted file mode 100644
index 8161babbe..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GravityHelperTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2011 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.common.layout;
-
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_BOTTOM;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_CENTER_HORIZ;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_CENTER_VERT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_END;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_FILL_HORIZ;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_FILL_VERT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_LEFT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_RIGHT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_START;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_TOP;
-import static com.android.ide.common.layout.GravityHelper.getGravity;
-
-import com.android.utils.XmlUtils;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class GravityHelperTest extends TestCase {
- public void testGravity() throws Exception {
- assertEquals(GRAVITY_BOTTOM, GravityHelper.getGravity("bottom", 0));
- assertEquals(GRAVITY_BOTTOM | GRAVITY_LEFT, GravityHelper.getGravity("bottom|left", 0));
- assertEquals(GRAVITY_BOTTOM | GRAVITY_LEFT | GRAVITY_START,
- GravityHelper.getGravity("bottom|left|start", 0));
- assertEquals(GRAVITY_BOTTOM | GRAVITY_LEFT | GRAVITY_START,
- GravityHelper.getGravity("bottom|start|left", 0));
- assertEquals(GRAVITY_BOTTOM | GRAVITY_RIGHT | GRAVITY_END,
- GravityHelper.getGravity("bottom|right|end", 0));
- assertEquals(GRAVITY_BOTTOM | GRAVITY_RIGHT | GRAVITY_END,
- GravityHelper.getGravity("bottom|end|right", 0));
- assertEquals(GRAVITY_CENTER_HORIZ | GRAVITY_CENTER_VERT,
- GravityHelper.getGravity("center", 0));
- }
-
- public void testGravityString() throws Exception {
- assertEquals("left", getGravity(GRAVITY_LEFT));
- assertEquals("start", getGravity(GRAVITY_START));
- assertEquals("right", getGravity(GRAVITY_RIGHT));
- assertEquals("end", getGravity(GRAVITY_END));
- assertEquals("top", getGravity(GRAVITY_TOP));
- assertEquals("bottom", getGravity(GRAVITY_BOTTOM));
- assertEquals("center_horizontal", getGravity(GRAVITY_CENTER_HORIZ));
- assertEquals("center_vertical", getGravity(GRAVITY_CENTER_VERT));
- assertEquals("fill_horizontal", getGravity(GRAVITY_FILL_HORIZ));
- assertEquals("fill_vertical", getGravity(GRAVITY_FILL_VERT));
-
- assertEquals("center", getGravity(GRAVITY_CENTER_HORIZ|GRAVITY_CENTER_VERT));
-
- assertEquals("left|bottom", getGravity(GRAVITY_LEFT|GRAVITY_BOTTOM));
- assertEquals("left|start|bottom", getGravity(GRAVITY_LEFT|GRAVITY_START|GRAVITY_BOTTOM));
- assertEquals("center_horizontal|top", getGravity(GRAVITY_CENTER_HORIZ|GRAVITY_TOP));
- }
-
- public void testConstrained() throws Exception {
- assertTrue(GravityHelper.isConstrainedHorizontally(GRAVITY_LEFT));
- assertTrue(GravityHelper.isConstrainedHorizontally(GRAVITY_START));
- assertTrue(GravityHelper.isConstrainedHorizontally(GRAVITY_RIGHT));
- assertTrue(GravityHelper.isConstrainedHorizontally(GRAVITY_END));
- assertTrue(GravityHelper.isConstrainedHorizontally(GRAVITY_CENTER_HORIZ));
- assertTrue(GravityHelper.isConstrainedHorizontally(GRAVITY_FILL_HORIZ));
-
- assertFalse(GravityHelper.isConstrainedVertically(GRAVITY_LEFT));
- assertFalse(GravityHelper.isConstrainedVertically(GRAVITY_START));
- assertFalse(GravityHelper.isConstrainedVertically(GRAVITY_RIGHT));
- assertFalse(GravityHelper.isConstrainedVertically(GRAVITY_END));
- assertFalse(GravityHelper.isConstrainedVertically(GRAVITY_CENTER_HORIZ));
- assertFalse(GravityHelper.isConstrainedVertically(GRAVITY_FILL_HORIZ));
-
- assertTrue(GravityHelper.isConstrainedVertically(GRAVITY_TOP));
- assertTrue(GravityHelper.isConstrainedVertically(GRAVITY_BOTTOM));
- assertTrue(GravityHelper.isConstrainedVertically(GRAVITY_CENTER_VERT));
- assertTrue(GravityHelper.isConstrainedVertically(GRAVITY_FILL_VERT));
-
- assertFalse(GravityHelper.isConstrainedHorizontally(GRAVITY_TOP));
- assertFalse(GravityHelper.isConstrainedHorizontally(GRAVITY_BOTTOM));
- assertFalse(GravityHelper.isConstrainedHorizontally(GRAVITY_CENTER_VERT));
- assertFalse(GravityHelper.isConstrainedHorizontally(GRAVITY_FILL_VERT));
- }
-
- public void testAligned() throws Exception {
- assertTrue(GravityHelper.isLeftAligned(GRAVITY_LEFT|GRAVITY_TOP));
- assertTrue(GravityHelper.isLeftAligned(GRAVITY_START|GRAVITY_TOP));
- assertTrue(GravityHelper.isLeftAligned(GRAVITY_LEFT));
- assertTrue(GravityHelper.isLeftAligned(GRAVITY_START));
- assertFalse(GravityHelper.isLeftAligned(GRAVITY_RIGHT));
- assertFalse(GravityHelper.isLeftAligned(GRAVITY_END));
-
- assertTrue(GravityHelper.isTopAligned(GRAVITY_LEFT|GRAVITY_TOP));
- assertTrue(GravityHelper.isTopAligned(GRAVITY_START|GRAVITY_TOP));
- assertTrue(GravityHelper.isTopAligned(GRAVITY_TOP));
- assertFalse(GravityHelper.isTopAligned(GRAVITY_BOTTOM));
- }
-
- public void testElement() throws Exception {
- Document document = XmlUtils.parseDocumentSilently(""
- + "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
- + "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n"
- + " android:layout_width=\"match_parent\"\n"
- + " android:layout_height=\"wrap_content\"\n"
- + " android:layout_gravity=\"start|center_vertical|left\""
- + " android:orientation=\"vertical\" />\n", true);
- assertNotNull(document);
- Element element = document.getDocumentElement();
- assertNotNull(element);
- int gravity = GravityHelper.getGravity(element);
- assertEquals("left|start|center_vertical", GravityHelper.getGravity(gravity));
- }
-} \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GridLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GridLayoutRuleTest.java
deleted file mode 100644
index f0483655d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/GridLayoutRuleTest.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2011 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.common.layout;
-
-
-public class GridLayoutRuleTest extends LayoutTestBase {
- @Override
- public void testDummy() {
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
deleted file mode 100644
index 4b4bb814a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.common.api.DropFeedback;
-import com.android.ide.common.api.IClientRulesEngine;
-import com.android.ide.common.api.IDragElement;
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.IValidator;
-import com.android.ide.common.api.IViewMetadata;
-import com.android.ide.common.api.IViewRule;
-import com.android.ide.common.api.Margins;
-import com.android.ide.common.api.Point;
-import com.android.ide.common.api.Rect;
-import com.android.ide.eclipse.adt.internal.editors.layout.gre.ViewMetadataRepository;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-/**
- * Common layout helpers from LayoutRule tests
- */
-@SuppressWarnings("javadoc")
-public class LayoutTestBase extends TestCase {
- /**
- * Helper function used by tests to drag a button into a canvas containing
- * the given children.
- *
- * @param rule The rule to test on
- * @param targetNode The target layout node to drag into
- * @param dragBounds The (original) bounds of the dragged item
- * @param dropPoint The drag point we should drag to and drop
- * @param secondDropPoint An optional second drag point to drag to before
- * drawing graphics and dropping (or null if not applicable)
- * @param insertIndex The expected insert position we end up with after
- * dropping at the dropPoint
- * @param currentIndex If the dragged widget is already in the canvas this
- * should be its child index; if not, pass in -1
- * @param graphicsFragments This is a varargs array of String fragments
- * we expect to see in the graphics output on the drag over
- * event.
- * @return The inserted node
- */
- protected INode dragInto(IViewRule rule, INode targetNode, Rect dragBounds, Point dropPoint,
- Point secondDropPoint, int insertIndex, int currentIndex,
- String... graphicsFragments) {
-
- String draggedButtonId = (currentIndex == -1) ? "@+id/DraggedButton" : targetNode
- .getChildren()[currentIndex].getStringAttr(ANDROID_URI, ATTR_ID);
-
- IDragElement[] elements = TestDragElement.create(TestDragElement.create(
- "android.widget.Button", dragBounds).id(draggedButtonId));
-
- // Enter target
- DropFeedback feedback = rule.onDropEnter(targetNode, null/*targetView*/, elements);
- assertNotNull(feedback);
- assertFalse(feedback.invalidTarget);
- assertNotNull(feedback.painter);
-
- if (currentIndex != -1) {
- feedback.sameCanvas = true;
- }
-
- // Move near top left corner of the target
- feedback = rule.onDropMove(targetNode, elements, feedback, dropPoint);
- assertNotNull(feedback);
-
- if (secondDropPoint != null) {
- feedback = rule.onDropMove(targetNode, elements, feedback, secondDropPoint);
- assertNotNull(feedback);
- }
-
- if (insertIndex == -1) {
- assertTrue(feedback.invalidTarget);
- } else {
- assertFalse(feedback.invalidTarget);
- }
-
- // Paint feedback and make sure it's what we expect
- TestGraphics graphics = new TestGraphics();
- assertNotNull(feedback.painter);
- feedback.painter.paint(graphics, targetNode, feedback);
- String drawn = graphics.getDrawn().toString();
-
- // Check that each graphics fragment is drawn
- for (String fragment : graphicsFragments) {
- if (!drawn.contains(fragment)) {
- // Get drawn-output since unit test truncates message in below
- // contains-assertion
- System.out.println("Could not find: " + fragment);
- System.out.println("Full graphics output: " + drawn);
- }
- assertTrue(fragment + " not found; full=" + drawn, drawn.contains(fragment));
- }
-
- // Attempt a drop?
- if (insertIndex == -1) {
- // No, not expected to succeed (for example, when drop point is over an
- // invalid region in RelativeLayout) - just return.
- return null;
- }
- int childrenCountBefore = targetNode.getChildren().length;
- rule.onDropped(targetNode, elements, feedback, dropPoint);
-
- if (currentIndex == -1) {
- // Inserting new from outside
- assertEquals(childrenCountBefore+1, targetNode.getChildren().length);
- } else {
- // Moving from existing; must remove in old position first
- ((TestNode) targetNode).removeChild(currentIndex);
-
- assertEquals(childrenCountBefore, targetNode.getChildren().length);
- }
- // Ensure that it's inserted in the right place
- String actualId = targetNode.getChildren()[insertIndex].getStringAttr(
- ANDROID_URI, ATTR_ID);
- if (!draggedButtonId.equals(actualId)) {
- // Using assertEquals instead of fail to get nice diff view on test
- // failure
- List<String> childrenIds = new ArrayList<String>();
- for (INode child : targetNode.getChildren()) {
- childrenIds.add(child.getStringAttr(ANDROID_URI, ATTR_ID));
- }
- int index = childrenIds.indexOf(draggedButtonId);
- String message = "Button found at index " + index + " instead of " + insertIndex
- + " among " + childrenIds;
- System.out.println(message);
- assertEquals(message, draggedButtonId, actualId);
- }
-
-
- return targetNode.getChildren()[insertIndex];
- }
-
- /**
- * Utility method for asserting that two collections contain exactly the
- * same elements (regardless of order)
- * @param expected expected collection
- * @param actual actual collection
- */
- public static void assertContainsSame(Collection<String> expected, Collection<String> actual) {
- if (expected.size() != actual.size()) {
- fail("Collection sizes differ; expected " + expected.size() + " but was "
- + actual.size());
- }
-
- // Sort prior to comparison to ensure we have the same elements
- // regardless of order
- List<String> expectedList = new ArrayList<String>(expected);
- Collections.sort(expectedList);
- List<String> actualList = new ArrayList<String>(actual);
- Collections.sort(actualList);
- // Instead of just assertEquals(expectedList, actualList);
- // we iterate one element at a time so we can show the first
- // -difference-.
- for (int i = 0; i < expectedList.size(); i++) {
- String expectedElement = expectedList.get(i);
- String actualElement = actualList.get(i);
- if (!expectedElement.equals(actualElement)) {
- System.out.println("Expected items: " + expectedList);
- System.out.println("Actual items : " + actualList);
- }
- assertEquals("Collections differ; first difference:", expectedElement, actualElement);
- }
- }
-
- protected void initialize(IViewRule rule, String fqn) {
- rule.onInitialize(fqn, new TestRulesEngine(fqn));
- }
-
- public static class TestRulesEngine implements IClientRulesEngine {
- private final String mFqn;
-
- public TestRulesEngine(String fqn) {
- mFqn = fqn;
- }
-
- @Override
- public void debugPrintf(@NonNull String msg, Object... params) {
- fail("Not supported in tests yet");
- }
-
- @Override
- public void displayAlert(@NonNull String message) {
- fail("Not supported in tests yet");
- }
-
- @Override
- public String displayInput(@NonNull String message, @Nullable String value,
- @Nullable IValidator filter) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public @NonNull String getFqcn() {
- return mFqn;
- }
-
- @Override
- public @NonNull IViewMetadata getMetadata(final @NonNull String fqcn) {
- return new IViewMetadata() {
- @Override
- public @NonNull String getDisplayName() {
- // This also works when there is no "."
- return fqcn.substring(fqcn.lastIndexOf('.') + 1);
- }
-
- @Override
- public @NonNull FillPreference getFillPreference() {
- return ViewMetadataRepository.get().getFillPreference(fqcn);
- }
-
- @Override
- public @NonNull Margins getInsets() {
- return null;
- }
-
- @Override
- public @NonNull List<String> getTopAttributes() {
- return ViewMetadataRepository.get().getTopAttributes(fqcn);
- }
- };
- }
-
- @Override
- public int getMinApiLevel() {
- return 8;
- }
-
- @Override
- public IViewRule loadRule(@NonNull String fqcn) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public String displayReferenceInput(String currentValue) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public IValidator getResourceValidator(String resourceTypeName, boolean uniqueInProject,
- boolean uniqueInLayout, boolean exists, String... allowed) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public String displayResourceInput(@NonNull String resourceTypeName,
- @Nullable String currentValue) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public String[] displayMarginInput(@Nullable String all, @Nullable String left,
- @Nullable String right, @Nullable String top, @Nullable String bottom) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public String displayIncludeSourceInput() {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public void select(@NonNull Collection<INode> nodes) {
- fail("Not supported in tests yet");
- }
-
- @Override
- public String displayFragmentSourceInput() {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public void layout() {
- fail("Not supported in tests yet");
- }
-
- @Override
- public void redraw() {
- fail("Not supported in tests yet");
- }
-
- @Override
- public Map<INode, Rect> measureChildren(@NonNull INode parent,
- @Nullable AttributeFilter filter) {
- return null;
- }
-
- @Override
- public int pxToDp(int px) {
- // Arbitrary conversion
- return px / 3;
- }
-
- @Override
- public int dpToPx(int dp) {
- // Arbitrary conversion
- return 3 * dp;
- }
-
- @Override
- public @NonNull String getUniqueId(@NonNull String prefix) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public int screenToLayout(int pixels) {
- fail("Not supported in tests yet");
- return pixels;
- }
-
- @Override
- public @NonNull String getAppNameSpace() {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public @Nullable Object getViewObject(@NonNull INode node) {
- fail("Not supported in tests yet");
- return null;
- }
-
- @Override
- public boolean rename(INode node) {
- fail("Not supported in tests yet");
- return false;
- }
-
- @Override
- @Nullable
- public String displayCustomViewClassInput() {
- fail("Not supported in tests yet");
- return null;
- }
- }
-
- public void testDummy() {
- // To avoid JUnit warning that this class contains no tests, even though
- // this is an abstract class and JUnit shouldn't try
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
deleted file mode 100644
index 9c4c934c0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
-import static com.android.SdkConstants.ATTR_ORIENTATION;
-import static com.android.SdkConstants.VALUE_HORIZONTAL;
-import static com.android.SdkConstants.VALUE_VERTICAL;
-
-import com.android.ide.common.api.DropFeedback;
-import com.android.ide.common.api.IAttributeInfo.Format;
-import com.android.ide.common.api.IDragElement;
-import com.android.ide.common.api.IMenuCallback;
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.IViewRule;
-import com.android.ide.common.api.Point;
-import com.android.ide.common.api.Rect;
-import com.android.ide.common.api.RuleAction;
-import com.android.ide.common.api.RuleAction.NestedAction;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/** Test the {@link LinearLayoutRule} */
-public class LinearLayoutRuleTest extends LayoutTestBase {
- // Utility for other tests
- protected void dragIntoEmpty(Rect dragBounds) {
- boolean haveBounds = dragBounds.isValid();
-
- IViewRule rule = new LinearLayoutRule();
-
- INode targetNode = TestNode.create("android.widget.LinearLayout").id(
- "@+id/LinearLayout01").bounds(new Rect(0, 0, 240, 480));
- Point dropPoint = new Point(10, 5);
-
- IDragElement[] elements = TestDragElement.create(TestDragElement.create(
- "android.widget.Button", dragBounds).id("@+id/Button01"));
-
- // Enter target
- DropFeedback feedback = rule.onDropEnter(targetNode, null/*targetView*/, elements);
- assertNotNull(feedback);
- assertFalse(feedback.invalidTarget);
- assertNotNull(feedback.painter);
-
- feedback = rule.onDropMove(targetNode, elements, feedback, dropPoint);
- assertNotNull(feedback);
- assertFalse(feedback.invalidTarget);
-
- // Paint feedback and make sure it's what we expect
- TestGraphics graphics = new TestGraphics();
- assertNotNull(feedback.painter);
- feedback.painter.paint(graphics, targetNode, feedback);
- assertEquals(
- // Expect to see a recipient rectangle around the bounds of the
- // LinearLayout,
- // as well as a single vertical line as a drop preview located
- // along the left
- // edge (for this horizontal linear layout) showing insert
- // position at index 0,
- // and finally a rectangle for the bounds of the inserted button
- // centered over
- // the middle
- "[useStyle(DROP_RECIPIENT), "
- +
- // Bounds rectangle
- "drawRect(Rect[0,0,240,480]), "
- + "useStyle(DROP_ZONE), drawLine(1,0,1,480), "
- + "useStyle(DROP_ZONE_ACTIVE), " + "useStyle(DROP_PREVIEW), " +
- // Insert position line
- "drawLine(1,0,1,480)" + (haveBounds ?
- // Outline of dragged node centered over position line
- ", useStyle(DROP_PREVIEW), " + "drawRect(1,0,101,80)"
- // Nothing when we don't have bounds
- : "") + "]", graphics.getDrawn().toString());
-
- // Attempt a drop
- assertEquals(0, targetNode.getChildren().length);
- rule.onDropped(targetNode, elements, feedback, dropPoint);
- assertEquals(1, targetNode.getChildren().length);
- assertEquals("@+id/Button01", targetNode.getChildren()[0].getStringAttr(
- ANDROID_URI, ATTR_ID));
- }
-
- // Utility for other tests
- protected INode dragInto(boolean vertical, Rect dragBounds, Point dragPoint,
- int insertIndex, int currentIndex,
- String... graphicsFragments) {
- INode linearLayout = TestNode.create("android.widget.LinearLayout").id(
- "@+id/LinearLayout01").bounds(new Rect(0, 0, 240, 480)).set(ANDROID_URI,
- ATTR_ORIENTATION,
- vertical ? VALUE_VERTICAL : VALUE_HORIZONTAL)
- .add(
- TestNode.create("android.widget.Button").id("@+id/Button01").bounds(
- new Rect(0, 0, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button02").bounds(
- new Rect(0, 100, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button03").bounds(
- new Rect(0, 200, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button04").bounds(
- new Rect(0, 300, 100, 80)));
-
- return super.dragInto(new LinearLayoutRule(), linearLayout, dragBounds, dragPoint, null,
- insertIndex, currentIndex, graphicsFragments);
- }
-
- // Check that the context menu registers the expected menu items
- public void testContextMenu() {
- LinearLayoutRule rule = new LinearLayoutRule();
- initialize(rule, "android.widget.LinearLayout");
- INode node = TestNode.create("android.widget.Button").id("@+id/Button012");
-
- List<RuleAction> contextMenu = new ArrayList<RuleAction>();
- rule.addContextMenuActions(contextMenu, node);
- assertEquals(6, contextMenu.size());
- assertEquals("Edit ID...", contextMenu.get(0).getTitle());
- assertTrue(contextMenu.get(1) instanceof RuleAction.Separator);
- assertEquals("Layout Width", contextMenu.get(2).getTitle());
- assertEquals("Layout Height", contextMenu.get(3).getTitle());
- assertTrue(contextMenu.get(4) instanceof RuleAction.Separator);
- assertEquals("Other Properties", contextMenu.get(5).getTitle());
-
- RuleAction propertiesMenu = contextMenu.get(5);
- assertTrue(propertiesMenu.getClass().getName(),
- propertiesMenu instanceof NestedAction);
- }
-
- public void testContextMenuCustom() {
- LinearLayoutRule rule = new LinearLayoutRule();
- initialize(rule, "android.widget.LinearLayout");
- INode node = TestNode.create("android.widget.LinearLayout").id("@+id/LinearLayout")
- .set(ANDROID_URI, ATTR_LAYOUT_WIDTH, "42dip")
- .set(ANDROID_URI, ATTR_LAYOUT_HEIGHT, "50sp");
-
- List<RuleAction> contextMenu = new ArrayList<RuleAction>();
- rule.addContextMenuActions(contextMenu, node);
- assertEquals(6, contextMenu.size());
- assertEquals("Layout Width", contextMenu.get(2).getTitle());
- RuleAction menuAction = contextMenu.get(2);
- assertTrue(menuAction instanceof RuleAction.Choices);
- RuleAction.Choices choices = (RuleAction.Choices) menuAction;
- List<String> titles = choices.getTitles();
- List<String> ids = choices.getIds();
- assertEquals("Wrap Content", titles.get(0));
- assertEquals("wrap_content", ids.get(0));
- assertEquals("Match Parent", titles.get(1));
- assertEquals("match_parent", ids.get(1));
- assertEquals("42dip", titles.get(2));
- assertEquals("42dip", ids.get(2));
- assertEquals("42dip", choices.getCurrent());
- }
-
- // Check that the context menu manipulates the orientation attribute
- public void testOrientation() {
- LinearLayoutRule rule = new LinearLayoutRule();
- initialize(rule, "android.widget.LinearLayout");
- TestNode node = TestNode.create("android.widget.LinearLayout").id("@+id/LinearLayout012");
- node.putAttributeInfo(ANDROID_URI, "orientation",
- new TestAttributeInfo(ATTR_ORIENTATION, Format.ENUM_SET,
- "android.widget.LinearLayout",
- new String[] {"horizontal", "vertical"}, null, null));
-
- assertNull(node.getStringAttr(ANDROID_URI, ATTR_ORIENTATION));
-
- List<RuleAction> contextMenu = new ArrayList<RuleAction>();
- rule.addContextMenuActions(contextMenu, node);
- assertEquals(7, contextMenu.size());
- RuleAction orientationAction = contextMenu.get(1);
- assertEquals("Orientation", orientationAction.getTitle());
-
- assertTrue(orientationAction.getClass().getName(),
- orientationAction instanceof RuleAction.Choices);
-
- RuleAction.Choices choices = (RuleAction.Choices) orientationAction;
- IMenuCallback callback = choices.getCallback();
- callback.action(orientationAction, Collections.singletonList(node), VALUE_VERTICAL, true);
-
- String orientation = node.getStringAttr(ANDROID_URI,
- ATTR_ORIENTATION);
- assertEquals(VALUE_VERTICAL, orientation);
- callback.action(orientationAction, Collections.singletonList(node), VALUE_HORIZONTAL,
- true);
- orientation = node.getStringAttr(ANDROID_URI, ATTR_ORIENTATION);
- assertEquals(VALUE_HORIZONTAL, orientation);
- }
-
- // Check that the context menu manipulates the orientation attribute
- public void testProperties() {
- LinearLayoutRule rule = new LinearLayoutRule();
- initialize(rule, "android.widget.LinearLayout");
- TestNode node = TestNode.create("android.widget.LinearLayout").id("@+id/LinearLayout012");
- node.putAttributeInfo(ANDROID_URI, "orientation",
- new TestAttributeInfo(ATTR_ORIENTATION, Format.ENUM_SET,
- "android.widget.LinearLayout",
- new String[] {"horizontal", "vertical"}, null, null));
- node.setAttributeSources(Arrays.asList("android.widget.LinearLayout",
- "android.view.ViewGroup", "android.view.View"));
- node.putAttributeInfo(ANDROID_URI, "gravity",
- new TestAttributeInfo("gravity", Format.INTEGER_SET,
- "android.widget.LinearLayout", null, null, null));
-
-
- assertNull(node.getStringAttr(ANDROID_URI, ATTR_ORIENTATION));
-
- List<RuleAction> contextMenu = new ArrayList<RuleAction>();
- rule.addContextMenuActions(contextMenu, node);
- assertEquals(8, contextMenu.size());
-
- assertEquals("Orientation", contextMenu.get(1).getTitle());
- assertEquals("Edit Gravity...", contextMenu.get(2).getTitle());
-
- assertEquals("Other Properties", contextMenu.get(7).getTitle());
-
- RuleAction propertiesMenu = contextMenu.get(7);
- assertTrue(propertiesMenu.getClass().getName(),
- propertiesMenu instanceof NestedAction);
- NestedAction nested = (NestedAction) propertiesMenu;
- List<RuleAction> nestedActions = nested.getNestedActions(node);
- assertEquals(9, nestedActions.size());
- assertEquals("Recent", nestedActions.get(0).getTitle());
- assertTrue(nestedActions.get(1) instanceof RuleAction.Separator);
- assertEquals("Defined by LinearLayout", nestedActions.get(2).getTitle());
- assertEquals("Inherited from ViewGroup", nestedActions.get(3).getTitle());
- assertEquals("Inherited from View", nestedActions.get(4).getTitle());
- assertTrue(nestedActions.get(5) instanceof RuleAction.Separator);
- assertEquals("Layout Parameters", nestedActions.get(6).getTitle());
- assertTrue(nestedActions.get(7) instanceof RuleAction.Separator);
- assertEquals("All By Name", nestedActions.get(8).getTitle());
-
- BaseViewRule.editedProperty(ATTR_ORIENTATION);
-
- RuleAction recentAction = nestedActions.get(0);
- assertTrue(recentAction instanceof NestedAction);
- NestedAction recentChoices = (NestedAction) recentAction;
- List<RuleAction> recentItems = recentChoices.getNestedActions(node);
-
- assertEquals(1, recentItems.size());
- assertEquals("Orientation", recentItems.get(0).getTitle());
-
- BaseViewRule.editedProperty("gravity");
- recentItems = recentChoices.getNestedActions(node);
- assertEquals(2, recentItems.size());
- assertEquals("Gravity...", recentItems.get(0).getTitle());
- assertEquals("Orientation", recentItems.get(1).getTitle());
-
- BaseViewRule.editedProperty(ATTR_ORIENTATION);
- recentItems = recentChoices.getNestedActions(node);
- assertEquals(2, recentItems.size());
- assertEquals("Orientation", recentItems.get(0).getTitle());
- assertEquals("Gravity...", recentItems.get(1).getTitle());
-
- // Lots of other properties -- flushes out properties that apply to this view
- for (int i = 0; i < 30; i++) {
- BaseViewRule.editedProperty("dummy_" + i);
- }
- recentItems = recentChoices.getNestedActions(node);
- assertEquals(0, recentItems.size());
-
- BaseViewRule.editedProperty("gravity");
- recentItems = recentChoices.getNestedActions(node);
- assertEquals(1, recentItems.size());
- assertEquals("Gravity...", recentItems.get(0).getTitle());
- }
-
- public void testDragInEmptyWithBounds() {
- dragIntoEmpty(new Rect(0, 0, 100, 80));
- }
-
- public void testDragInEmptyWithoutBounds() {
- dragIntoEmpty(new Rect(0, 0, 0, 0));
- }
-
- public void testDragInVerticalTop() {
- dragInto(true,
- // Bounds of the dragged item
- new Rect(0, 0, 105, 80),
- // Drag point
- new Point(30, -10),
- // Expected insert location
- 0,
- // Not dragging one of the existing children
- -1,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop zones
- "useStyle(DROP_ZONE), drawLine(0,0,240,0), drawLine(0,90,240,90), "
- + "drawLine(0,190,240,190), drawLine(0,290,240,290), "
- + "drawLine(0,381,240,381)",
-
- // Active nearest line
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawLine(0,0,240,0)",
-
- // Preview of the dropped rectangle
- "useStyle(DROP_PREVIEW), drawRect(0,-40,105,40)");
-
- // Without drag bounds it should be identical except no preview
- // rectangle
- dragInto(true,
- new Rect(0, 0, 0, 0), // Invalid
- new Point(30, -10), 0, -1,
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawLine(0,0,240,0)");
- }
-
- public void testDragInVerticalBottom() {
- dragInto(true,
- // Bounds of the dragged item
- new Rect(0, 0, 105, 80),
- // Drag point
- new Point(30, 500),
- // Expected insert location
- 4,
- // Not dragging one of the existing children
- -1,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop zones
- "useStyle(DROP_ZONE), drawLine(0,0,240,0), drawLine(0,90,240,90), "
- + "drawLine(0,190,240,190), drawLine(0,290,240,290), drawLine(0,381,240,381), ",
-
- // Active nearest line
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawLine(0,381,240,381)",
-
- // Preview of the dropped rectangle
- "useStyle(DROP_PREVIEW), drawRect(0,381,105,461)");
-
- // Check without bounds too
- dragInto(true, new Rect(0, 0, 105, 80), new Point(30, 500), 4, -1,
- "useStyle(DROP_PREVIEW), drawRect(0,381,105,461)");
- }
-
- public void testDragInVerticalMiddle() {
- dragInto(true,
- // Bounds of the dragged item
- new Rect(0, 0, 105, 80),
- // Drag point
- new Point(0, 170),
- // Expected insert location
- 2,
- // Not dragging one of the existing children
- -1,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop zones
- "useStyle(DROP_ZONE), drawLine(0,0,240,0), drawLine(0,90,240,90), "
- + "drawLine(0,190,240,190), drawLine(0,290,240,290)",
-
- // Active nearest line
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawLine(0,190,240,190)",
-
- // Preview of the dropped rectangle
- "useStyle(DROP_PREVIEW), drawRect(0,150,105,230)");
-
- // Check without bounds too
- dragInto(true, new Rect(0, 0, 105, 80), new Point(0, 170), 2, -1,
- "useStyle(DROP_PREVIEW), drawRect(0,150,105,230)");
- }
-
- public void testDragInVerticalMiddleSelfPos() {
- // Drag the 2nd button, down to the position between 3rd and 4th
- dragInto(true,
- // Bounds of the dragged item
- new Rect(0, 100, 100, 80),
- // Drag point
- new Point(0, 250),
- // Expected insert location
- 2,
- // Dragging 1st item
- 1,
- // Bounds rectangle
-
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop zones - these are different because we exclude drop
- // zones around the
- // dragged item itself (it doesn't make sense to insert directly
- // before or after
- // myself
- "useStyle(DROP_ZONE), drawLine(0,0,240,0), drawLine(0,290,240,290), "
- + "drawLine(0,381,240,381)",
-
- // Preview line along insert axis
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawLine(0,290,240,290)",
-
- // Preview of dropped rectangle
- "useStyle(DROP_PREVIEW), drawRect(0,250,100,330)");
-
- // Test dropping on self (no position change):
- dragInto(true,
- // Bounds of the dragged item
- new Rect(0, 100, 100, 80),
- // Drag point
- new Point(0, 210),
- // Expected insert location
- 1,
- // Dragging from same pos
- 1,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop zones - these are different because we exclude drop
- // zones around the
- // dragged item itself (it doesn't make sense to insert directly
- // before or after
- // myself
- "useStyle(DROP_ZONE), drawLine(0,0,240,0), drawLine(0,290,240,290), "
- + "drawLine(0,381,240,381)",
-
- // No active nearest line when you're over the self pos!
-
- // Preview of the dropped rectangle
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawRect(0,100,100,180)");
- }
-
- public void testDragToLastPosition() {
- // Drag a button to the last position -- and confirm that the preview rectangle
- // is now shown midway between the second to last and last positions, but fully
- // below the drop zone line:
- dragInto(true,
- // Bounds of the dragged item
- new Rect(0, 100, 100, 80),
- // Drag point
- new Point(0, 400),
- // Expected insert location
- 3,
- // Dragging 1st item
- 1,
-
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop Zones
- "useStyle(DROP_ZONE), drawLine(0,0,240,0), drawLine(0,290,240,290), " +
- "drawLine(0,381,240,381), ",
-
- // Active Drop Zone
- "useStyle(DROP_ZONE_ACTIVE), useStyle(DROP_PREVIEW), drawLine(0,381,240,381)",
-
- // Drop Preview
- "useStyle(DROP_PREVIEW), drawRect(0,381,100,461)");
- }
-
- // Left to test:
- // Check inserting at last pos with multiple children
- // Check inserting with no bounds rectangle for dragged element
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java
deleted file mode 100644
index f9747f39d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-
-import static com.android.SdkConstants.ANDROID_URI;
-
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Point;
-import com.android.ide.common.api.Rect;
-
-/** Test the {@link RelativeLayoutRule} */
-public class RelativeLayoutRuleTest extends LayoutTestBase {
- // Utility for other tests
- protected INode dragInto(Rect dragBounds, Point dragPoint, Point secondDragPoint,
- int insertIndex, int currentIndex, String... graphicsFragments) {
- INode layout = TestNode.create("android.widget.RelativeLayout").id("@+id/RelativeLayout01")
- .bounds(new Rect(0, 0, 240, 480)).add(
- // Add centered button as the anchor
- TestNode.create("android.widget.Button").id("@+id/Centered").bounds(
- new Rect(70, 200, 100, 80)).set(ANDROID_URI,
- "layout_centerInParent", "true"),
- // Add a second button anchored to it
- TestNode.create("android.widget.Button").id("@+id/Below").bounds(
- new Rect(70, 280, 100, 80)).set(ANDROID_URI, "layout_below",
- "@+id/Centered").set(ANDROID_URI, "layout_alignLeft",
- "@+id/Centered"));
-
- return super.dragInto(new RelativeLayoutRule(), layout, dragBounds, dragPoint,
- secondDragPoint, insertIndex, currentIndex, graphicsFragments);
- }
-
- protected INode dragInto(Rect dragBounds, Point dragPoint, Point secondDragPoint,
- int insertIndex, int currentIndex, String[] extraFragments,
- String... graphicsFragments) {
-
- // When we switch to JDK6, use Arrays#copyOf instead
- String[] combined = new String[extraFragments.length + graphicsFragments.length];
- System.arraycopy(graphicsFragments, 0, combined, 0, graphicsFragments.length);
- System.arraycopy(extraFragments, 0, combined, graphicsFragments.length,
- extraFragments.length);
-
- return dragInto(dragBounds, dragPoint, secondDragPoint, insertIndex,
- currentIndex, combined);
- }
-
- /* This needs to be updated for the new interaction
- public void testDropTopEdge() {
- // If we drag right into the button itself, not a valid drop position
- INode inserted = dragInto(
- new Rect(0, 0, 105, 80), new Point(30, -10), null, 2, -1,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Preview line + drop zone rectangle along the top
- "useStyle(DROP_ZONE), drawRect(Rect[0,-10,240,20])",
- "useStyle(DROP_ZONE_ACTIVE), fillRect(Rect[0,-10,240,20])",
- "useStyle(DROP_PREVIEW), drawLine(0,0,240,0)",
-
- // Tip
- "useStyle(HELP), drawBoxedStrings(5,15,[alignParentTop])",
-
- // Drop preview
- "useStyle(DROP_PREVIEW), drawRect(Rect[0,0,105,80])");
-
- assertEquals("true", inserted.getStringAttr(ANDROID_URI,
- "layout_alignParentTop"));
- }
-
- public void testDropZones() {
- List<Pair<Point,String[]>> zones = new ArrayList<Pair<Point,String[]>>();
-
- zones.add(Pair.of(new Point(51+10, 181+10),
- new String[] {"above=@+id/Centered", "toLeftOf=@+id/Centered"}));
- zones.add(Pair.of(new Point(71+10, 181+10),
- new String[] {"above=@+id/Centered", "alignLeft=@+id/Centered"}));
- zones.add(Pair.of(new Point(104+10, 181+10),
- new String[] {"above=@+id/Centered", "alignRight=@+id/Centered"}));
- zones.add(Pair.of(new Point(137+10, 181+10),
- new String[] {"above=@+id/Centered", "alignRight=@+id/Centered"}));
- zones.add(Pair.of(new Point(170+10, 181+10),
- new String[] {"above=@+id/Centered", "toRightOf=@+id/Centered"}));
- zones.add(Pair.of(new Point(51+10, 279+10),
- new String[] {"below=@+id/Centered", "toLeftOf=@+id/Centered"}));
- zones.add(Pair.of(new Point(71+10, 279+10),
- new String[] {"below=@+id/Centered", "alignLeft=@+id/Centered"}));
- zones.add(Pair.of(new Point(104+10, 279+10),
- new String[] {"below=@+id/Centered", "alignLeft=@+id/Centered"}));
- zones.add(Pair.of(new Point(137+10, 279+10),
- new String[] {"below=@+id/Centered", "alignRight=@+id/Centered"}));
- zones.add(Pair.of(new Point(170+10, 279+10),
- new String[] {"below=@+id/Centered", "toRightOf=@+id/Centered"}));
- zones.add(Pair.of(new Point(51+10, 201+10),
- new String[] {"toLeftOf=@+id/Centered", "alignTop=@+id/Centered"}));
- zones.add(Pair.of(new Point(51+10, 227+10),
- new String[] {"toLeftOf=@+id/Centered", "alignTop=@+id/Centered"}));
- zones.add(Pair.of(new Point(170+10, 201+10),
- new String[] {"toRightOf=@+id/Centered", "alignTop=@+id/Centered"}));
- zones.add(Pair.of(new Point(51+10, 253+10),
- new String[] {"toLeftOf=@+id/Centered", "alignBottom=@+id/Centered"}));
- zones.add(Pair.of(new Point(170+10, 227+10),
- new String[] {"toRightOf=@+id/Centered", "alignTop=@+id/Centered",
- "alignBottom=@+id/Centered"}));
- zones.add(Pair.of(new Point(170+10, 253+10),
- new String[] {"toRightOf=@+id/Centered", "alignBottom=@+id/Centered"}));
-
- for (Pair<Point,String[]> zonePair : zones) {
- Point dropPoint = zonePair.getFirst();
- String[] attachments = zonePair.getSecond();
- // If we drag right into the button itself, not a valid drop position
-
- INode inserted = dragInto(
- new Rect(0, 0, 105, 80), new Point(120, 240), dropPoint, 1, -1,
- attachments,
-
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Drop zones
- "useStyle(DROP_ZONE), "
- + "drawRect(Rect[51,181,20,20]), drawRect(Rect[71,181,33,20]), "
- + "drawRect(Rect[104,181,33,20]), drawRect(Rect[137,181,33,20]), "
- + "drawRect(Rect[170,181,20,20]), drawRect(Rect[51,279,20,20]), "
- + "drawRect(Rect[71,279,33,20]), drawRect(Rect[104,279,33,20]), "
- + "drawRect(Rect[137,279,33,20]), drawRect(Rect[170,279,20,20]), "
- + "drawRect(Rect[51,201,20,26]), drawRect(Rect[51,227,20,26]), "
- + "drawRect(Rect[51,253,20,26]), drawRect(Rect[170,201,20,26]), "
- + "drawRect(Rect[170,227,20,26]), drawRect(Rect[170,253,20,26])");
-
- for (String attachment : attachments) {
- String[] elements = attachment.split("=");
- String name = "layout_" + elements[0];
- String value = elements[1];
- assertEquals(value, inserted.getStringAttr(ANDROID_URI, name));
- }
- }
- }
-
-
- public void testDragInvalid() {
- // If we drag right into the button itself, not a valid drop position
- dragInto(new Rect(70, 200, 100, 80), new Point(120, 240), new Point(120, 240), -1, 0,
- // Bounds rectangle
- "useStyle(DROP_RECIPIENT), drawRect(Rect[0,0,240,480])",
-
- // Invalid marker
- "useStyle(INVALID), fillRect(Rect[70,200,100,80]), drawLine(70,200,170,280), "
- + "drawLine(70,280,170,200)");
- }
-
- // TODO: Test error (dragging on ancestor)
- */
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java
deleted file mode 100644
index 752d61c77..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import com.android.annotations.NonNull;
-import com.android.ide.common.api.IDragElement.IDragAttribute;
-import com.android.ide.common.api.INode.IAttribute;
-import com.android.ide.common.xml.XmlAttributeSortOrder;
-
-/** Test/mock implementation of {@link IAttribute} and {@link IDragAttribute} */
-public class TestAttribute implements IAttribute, IDragAttribute {
- private String mUri;
-
- private String mName;
-
- private String mValue;
-
- public TestAttribute(String mUri, String mName, String mValue) {
- super();
- this.mName = mName;
- this.mUri = mUri;
- this.mValue = mValue;
- }
-
- @Override
- public @NonNull String getName() {
- return mName;
- }
-
- @Override
- public @NonNull String getUri() {
- return mUri;
- }
-
- @Override
- public @NonNull String getValue() {
- return mValue;
- }
-
- @Override
- public String toString() {
- return "TestAttribute [name=" + mName + ", uri=" + mUri + ", value=" + mValue + "]";
- }
-
- public int compareTo(IDragAttribute o) {
- return XmlAttributeSortOrder.compareAttributes(mName, o.getName());
- }
-} \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java
deleted file mode 100644
index 69984bdbf..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttributeInfo.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import com.android.annotations.NonNull;
-import com.android.ide.common.api.IAttributeInfo;
-
-import java.util.EnumSet;
-
-/** Test/mock implementation of {@link IAttributeInfo} */
-public class TestAttributeInfo implements IAttributeInfo {
- private final String mName;
- private final EnumSet<Format> mFormats;
- private final String mDefinedBy;
- private final String[] mEnumValues;
- private final String[] mFlagValues;
- private final String mJavadoc;
-
- public TestAttributeInfo(String name) {
- this(name, null, null, null, null, null);
- }
-
- public TestAttributeInfo(String name, EnumSet<Format> formats, String definedBy,
- String[] enumValues, String[] flagValues, String javadoc) {
- super();
- this.mName = name;
- this.mFormats = formats;
- this.mDefinedBy = definedBy;
- this.mEnumValues = enumValues;
- this.mFlagValues = flagValues;
- this.mJavadoc = javadoc;
- }
-
- @Override
- public String getDeprecatedDoc() {
- return null;
- }
-
- @Override
- public String[] getEnumValues() {
- return mEnumValues;
- }
-
- @Override
- public String[] getFlagValues() {
- return mFlagValues;
- }
-
- @Override
- public @NonNull EnumSet<Format> getFormats() {
- return mFormats;
- }
-
- @Override
- public @NonNull String getJavaDoc() {
- return mJavadoc;
- }
-
- @Override
- public @NonNull String getName() {
- return mName;
- }
-
- @Override
- public @NonNull String getDefinedBy() {
- return mDefinedBy;
- }
-} \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestColor.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestColor.java
deleted file mode 100644
index 449ad5ebb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestColor.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import com.android.ide.common.api.IColor;
-
-public class TestColor implements IColor {
- private int mRgb;
-
- public TestColor(int rgb) {
- this.mRgb = rgb;
- }
-
- public int getRgb() {
- return mRgb;
- }
-
- @Override
- public String toString() {
- return String.format("#%6x", mRgb);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java
deleted file mode 100644
index b96de60c7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.common.api.IDragElement;
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Rect;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/** Test/mock implementation of {@link IDragElement} */
-public class TestDragElement implements IDragElement {
- private Rect mRect;
-
- private final String mFqcn;
-
- private Map<String, TestAttribute> mAttributes = new HashMap<String, TestAttribute>();
-
- private List<TestDragElement> mChildren = new ArrayList<TestDragElement>();
-
- private TestDragElement mParent;
-
- public TestDragElement(String mFqcn, Rect mRect, List<TestDragElement> mChildren,
- TestDragElement mParent) {
- super();
- this.mRect = mRect;
- this.mFqcn = mFqcn;
- this.mChildren = mChildren;
- this.mParent = mParent;
- }
-
- public TestDragElement(String fqn) {
- this(fqn, null, null, null);
- }
-
- public TestDragElement setBounds(Rect bounds) {
- this.mRect = bounds;
-
- return this;
- }
-
- // Builder stuff
- public TestDragElement set(String uri, String name, String value) {
- if (mAttributes == null) {
- mAttributes = new HashMap<String, TestAttribute>();
- }
-
- mAttributes.put(uri + name, new TestAttribute(uri, name, value));
-
- return this;
- }
-
- public TestDragElement add(TestDragElement... children) {
- if (mChildren == null) {
- mChildren = new ArrayList<TestDragElement>();
- }
-
- for (TestDragElement child : children) {
- mChildren.add(child);
- child.mParent = this;
- }
-
- return this;
- }
-
- public TestDragElement id(String id) {
- return set(ANDROID_URI, ATTR_ID, id);
- }
-
- public static TestDragElement create(String fqn, Rect bounds) {
- return create(fqn).setBounds(bounds);
- }
-
- public static TestDragElement create(String fqn) {
- return new TestDragElement(fqn);
- }
-
- public static IDragElement[] create(TestDragElement... elements) {
- return elements;
- }
-
- // ==== IDragElement ====
-
- @Override
- public IDragAttribute getAttribute(@Nullable String uri, @NonNull String localName) {
- if (mAttributes == null) {
- return new TestAttribute(uri, localName, "");
- }
-
- return mAttributes.get(uri + localName);
- }
-
- @Override
- public @NonNull IDragAttribute[] getAttributes() {
- return mAttributes.values().toArray(new IDragAttribute[mAttributes.size()]);
- }
-
- @Override
- public @NonNull Rect getBounds() {
- return mRect;
- }
-
- @Override
- public @NonNull String getFqcn() {
- return mFqcn;
- }
-
- @Override
- public @NonNull IDragElement[] getInnerElements() {
- if (mChildren == null) {
- return new IDragElement[0];
- }
-
- return mChildren.toArray(new IDragElement[mChildren.size()]);
- }
-
- @Override
- public @NonNull Rect getParentBounds() {
- return mParent != null ? mParent.getBounds() : null;
- }
-
- @Override
- public String getParentFqcn() {
- return mParent != null ? mParent.getFqcn() : null;
- }
-
- @Override
- public String toString() {
- return "TestDragElement [fqn=" + mFqcn + ", attributes=" + mAttributes + ", bounds="
- + mRect + "]";
- }
-
- @Override
- public boolean isSame(INode node) {
- return node.getBounds().equals(getBounds());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java
deleted file mode 100644
index ec9321003..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestGraphics.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import com.android.annotations.NonNull;
-import com.android.ide.common.api.DrawingStyle;
-import com.android.ide.common.api.IColor;
-import com.android.ide.common.api.IGraphics;
-import com.android.ide.common.api.Point;
-import com.android.ide.common.api.Rect;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-// TODO: Create box of ascii art
-
-public class TestGraphics implements IGraphics {
- /** List of things we have drawn */
- private List<String> mDrawn = new ArrayList<String>();
-
- private IColor mBackground = new TestColor(0x000000);
-
- private IColor mForeground = new TestColor(0xFFFFFF);
-
- private int mAlpha = 128;
-
- /** Return log of graphics calls */
- public List<String> getDrawn() {
- return Collections.unmodifiableList(mDrawn);
- }
-
- /** Wipe out log of graphics calls */
- public void clear() {
- mDrawn.clear();
- }
-
- // ==== IGraphics ====
-
- @Override
- public void drawBoxedStrings(int x, int y, @NonNull List<?> strings) {
- mDrawn.add("drawBoxedStrings(" + x + "," + y + "," + strings + ")");
- }
-
- @Override
- public void drawLine(int x1, int y1, int x2, int y2) {
- mDrawn.add("drawLine(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")");
- }
-
- @Override
- public void drawLine(@NonNull Point p1, @NonNull Point p2) {
- mDrawn.add("drawLine(" + p1 + "," + p2 + ")");
- }
-
- @Override
- public void drawRect(int x1, int y1, int x2, int y2) {
- mDrawn.add("drawRect(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")");
- }
-
- @Override
- public void drawRect(@NonNull Point p1, @NonNull Point p2) {
- mDrawn.add("drawRect(" + p1 + "," + p2 + ")");
- }
-
- @Override
- public void drawRect(@NonNull Rect r) {
- mDrawn.add("drawRect(" + rectToString(r) + ")");
- }
-
- @Override
- public void drawString(@NonNull String string, int x, int y) {
- mDrawn.add("drawString(" + x + "," + y + "," + string + ")");
- }
-
- @Override
- public void drawString(@NonNull String string, @NonNull Point topLeft) {
- mDrawn.add("drawString(" + string + "," + topLeft + ")");
- }
-
- @Override
- public void fillRect(int x1, int y1, int x2, int y2) {
- mDrawn.add("fillRect(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")");
- }
-
- @Override
- public void fillRect(@NonNull Point p1, @NonNull Point p2) {
- mDrawn.add("fillRect(" + p1 + "," + p2 + ")");
- }
-
- @Override
- public void fillRect(@NonNull Rect r) {
- mDrawn.add("fillRect(" + rectToString(r) + ")");
- }
-
- @Override
- public int getAlpha() {
- return mAlpha;
- }
-
- @Override
- public @NonNull IColor getBackground() {
- return mBackground;
- }
-
- @Override
- public int getFontHeight() {
- return 12;
- }
-
- @Override
- public @NonNull IColor getForeground() {
- return mForeground;
- }
-
- @Override
- public @NonNull IColor registerColor(int rgb) {
- mDrawn.add("registerColor(" + Integer.toHexString(rgb) + ")");
- return new TestColor(rgb);
- }
-
- @Override
- public void setAlpha(int alpha) {
- mAlpha = alpha;
- mDrawn.add("setAlpha(" + alpha + ")");
- }
-
- @Override
- public void setBackground(@NonNull IColor color) {
- mDrawn.add("setBackground(" + color + ")");
- mBackground = color;
- }
-
- @Override
- public void setForeground(@NonNull IColor color) {
- mDrawn.add("setForeground(" + color + ")");
- mForeground = color;
- }
-
- @Override
- public void setLineStyle(@NonNull LineStyle style) {
- mDrawn.add("setLineStyle(" + style + ")");
- }
-
- @Override
- public void setLineWidth(int width) {
- mDrawn.add("setLineWidth(" + width + ")");
- }
-
- @Override
- public void useStyle(@NonNull DrawingStyle style) {
- mDrawn.add("useStyle(" + style + ")");
- }
-
- @Override
- public void drawArrow(int x1, int y1, int x2, int y2, int size) {
- mDrawn.add("drawArrow(" + x1 + "," + y1 + "," + x2 + "," + y2 + ")");
- }
-
- @Override
- public void drawPoint(int x, int y) {
- mDrawn.add("drawPoint(" + x + "," + y + ")");
- }
-
- private static String rectToString(Rect rect) {
- return "Rect[" + rect.x + "," + rect.y + "," + rect.w + "," + rect.h + "]";
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java
deleted file mode 100644
index 30886e4fa..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ANDROID_WIDGET_PREFIX;
-import static com.android.SdkConstants.ATTR_ID;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.fail;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.common.api.IAttributeInfo;
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.INodeHandler;
-import com.android.ide.common.api.Margins;
-import com.android.ide.common.api.Rect;
-import com.android.ide.common.xml.XmlFormatStyle;
-import com.android.ide.common.xml.XmlPrettyPrinter;
-import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
-import com.google.common.base.Splitter;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/** Test/mock implementation of {@link INode} */
-@SuppressWarnings("javadoc")
-public class TestNode implements INode {
- private TestNode mParent;
-
- private final List<TestNode> mChildren = new ArrayList<TestNode>();
-
- private final String mFqcn;
-
- private Rect mBounds = new Rect(); // Invalid bounds initially
-
- private Map<String, IAttribute> mAttributes = new HashMap<String, IAttribute>();
-
- private Map<String, IAttributeInfo> mAttributeInfos = new HashMap<String, IAttributeInfo>();
-
- private List<String> mAttributeSources;
-
- public TestNode(String fqcn) {
- this.mFqcn = fqcn;
- }
-
- public TestNode bounds(Rect bounds) {
- this.mBounds = bounds;
-
- return this;
- }
-
- public TestNode id(String id) {
- return set(ANDROID_URI, ATTR_ID, id);
- }
-
- public TestNode set(String uri, String name, String value) {
- setAttribute(uri, name, value);
-
- return this;
- }
-
- public TestNode add(TestNode child) {
- mChildren.add(child);
- child.mParent = this;
-
- return this;
- }
-
- public TestNode add(TestNode... children) {
- for (TestNode child : children) {
- mChildren.add(child);
- child.mParent = this;
- }
-
- return this;
- }
-
- public static TestNode create(String fcqn) {
- return new TestNode(fcqn);
- }
-
- public void removeChild(int index) {
- TestNode removed = mChildren.remove(index);
- removed.mParent = null;
- }
-
- // ==== INODE ====
-
- @Override
- public @NonNull INode appendChild(@NonNull String viewFqcn) {
- return insertChildAt(viewFqcn, mChildren.size());
- }
-
- @Override
- public void editXml(@NonNull String undoName, @NonNull INodeHandler callback) {
- callback.handle(this);
- }
-
- public void putAttributeInfo(String uri, String attrName, IAttributeInfo info) {
- mAttributeInfos.put(uri + attrName, info);
- }
-
- @Override
- public IAttributeInfo getAttributeInfo(@Nullable String uri, @NonNull String attrName) {
- return mAttributeInfos.get(uri + attrName);
- }
-
- @Override
- public @NonNull Rect getBounds() {
- return mBounds;
- }
-
- @Override
- public @NonNull INode[] getChildren() {
- return mChildren.toArray(new INode[mChildren.size()]);
- }
-
- @Override
- public @NonNull IAttributeInfo[] getDeclaredAttributes() {
- return mAttributeInfos.values().toArray(new IAttributeInfo[mAttributeInfos.size()]);
- }
-
- @Override
- public @NonNull String getFqcn() {
- return mFqcn;
- }
-
- @Override
- public @NonNull IAttribute[] getLiveAttributes() {
- return mAttributes.values().toArray(new IAttribute[mAttributes.size()]);
- }
-
- @Override
- public INode getParent() {
- return mParent;
- }
-
- @Override
- public INode getRoot() {
- TestNode curr = this;
- while (curr.mParent != null) {
- curr = curr.mParent;
- }
-
- return curr;
- }
-
- @Override
- public String getStringAttr(@Nullable String uri, @NonNull String attrName) {
- IAttribute attr = mAttributes.get(uri + attrName);
- if (attr == null) {
- return null;
- }
-
- return attr.getValue();
- }
-
- @Override
- public @NonNull INode insertChildAt(@NonNull String viewFqcn, int index) {
- TestNode child = new TestNode(viewFqcn);
- if (index == -1) {
- mChildren.add(child);
- } else {
- mChildren.add(index, child);
- }
- child.mParent = this;
- return child;
- }
-
- @Override
- public void removeChild(@NonNull INode node) {
- int index = mChildren.indexOf(node);
- if (index != -1) {
- removeChild(index);
- }
- }
-
- @Override
- public boolean setAttribute(@Nullable String uri, @NonNull String localName,
- @Nullable String value) {
- mAttributes.put(uri + localName, new TestAttribute(uri, localName, value));
- return true;
- }
-
- @Override
- public String toString() {
- String id = getStringAttr(ANDROID_URI, ATTR_ID);
- return "TestNode [id=" + (id != null ? id : "?") + ", fqn=" + mFqcn + ", infos="
- + mAttributeInfos + ", attributes=" + mAttributes + ", bounds=" + mBounds + "]";
- }
-
- @Override
- public int getBaseline() {
- return -1;
- }
-
- @Override
- public @NonNull Margins getMargins() {
- return null;
- }
-
- @Override
- public @NonNull List<String> getAttributeSources() {
- return mAttributeSources != null ? mAttributeSources : Collections.<String>emptyList();
- }
-
- public void setAttributeSources(List<String> attributeSources) {
- mAttributeSources = attributeSources;
- }
-
- /** Create a test node from the given XML */
- public static TestNode createFromXml(String xml) {
- Document document = DomUtilities.parseDocument(xml, false);
- assertNotNull(document);
- assertNotNull(document.getDocumentElement());
-
- return createFromNode(document.getDocumentElement());
- }
-
- public static String toXml(TestNode node) {
- assertTrue("This method only works with nodes constructed from XML",
- node instanceof TestXmlNode);
- Document document = ((TestXmlNode) node).mElement.getOwnerDocument();
- // Insert new whitespace nodes etc
- String xml = dumpDocument(document);
- document = DomUtilities.parseDocument(xml, false);
-
- XmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(EclipseXmlFormatPreferences.create(),
- XmlFormatStyle.LAYOUT, "\n");
- StringBuilder sb = new StringBuilder(1000);
- sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
- printer.prettyPrint(-1, document, null, null, sb, false);
- return sb.toString();
- }
-
- @SuppressWarnings("deprecation")
- private static String dumpDocument(Document document) {
- // Diagnostics: print out the XML that we're about to render
- org.apache.xml.serialize.OutputFormat outputFormat =
- new org.apache.xml.serialize.OutputFormat(
- "XML", "ISO-8859-1", true); //$NON-NLS-1$ //$NON-NLS-2$
- outputFormat.setIndent(2);
- outputFormat.setLineWidth(100);
- outputFormat.setIndenting(true);
- outputFormat.setOmitXMLDeclaration(true);
- outputFormat.setOmitDocumentType(true);
- StringWriter stringWriter = new StringWriter();
- // Using FQN here to avoid having an import above, which will result
- // in a deprecation warning, and there isn't a way to annotate a single
- // import element with a SuppressWarnings.
- org.apache.xml.serialize.XMLSerializer serializer =
- new org.apache.xml.serialize.XMLSerializer(stringWriter, outputFormat);
- serializer.setNamespaces(true);
- try {
- serializer.serialize(document.getDocumentElement());
- return stringWriter.toString();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- private static TestNode createFromNode(Element element) {
- String fqcn = ANDROID_WIDGET_PREFIX + element.getTagName();
- TestNode node = new TestXmlNode(fqcn, element);
-
- for (Element child : DomUtilities.getChildren(element)) {
- node.add(createFromNode(child));
- }
-
- return node;
- }
-
- @Nullable
- public static TestNode findById(TestNode node, String id) {
- id = BaseLayoutRule.stripIdPrefix(id);
- return node.findById(id);
- }
-
- private TestNode findById(String targetId) {
- String id = getStringAttr(ANDROID_URI, ATTR_ID);
- if (id != null && targetId.equals(BaseLayoutRule.stripIdPrefix(id))) {
- return this;
- }
-
- for (TestNode child : mChildren) {
- TestNode result = child.findById(targetId);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-
- private static String getTagName(String fqcn) {
- return fqcn.substring(fqcn.lastIndexOf('.') + 1);
- }
-
- private static class TestXmlNode extends TestNode {
- private final Element mElement;
-
- public TestXmlNode(String fqcn, Element element) {
- super(fqcn);
- mElement = element;
- }
-
- @Override
- public @NonNull IAttribute[] getLiveAttributes() {
- List<IAttribute> result = new ArrayList<IAttribute>();
-
- NamedNodeMap attributes = mElement.getAttributes();
- for (int i = 0, n = attributes.getLength(); i < n; i++) {
- Attr attribute = (Attr) attributes.item(i);
- result.add(new TestXmlAttribute(attribute));
- }
- return result.toArray(new IAttribute[result.size()]);
- }
-
- @Override
- public boolean setAttribute(String uri, String localName, String value) {
- if (value == null) {
- mElement.removeAttributeNS(uri, localName);
- } else {
- mElement.setAttributeNS(uri, localName, value);
- }
- return super.setAttribute(uri, localName, value);
- }
-
- @Override
- public INode appendChild(String viewFqcn) {
- Element child = mElement.getOwnerDocument().createElement(getTagName(viewFqcn));
- mElement.appendChild(child);
- return new TestXmlNode(viewFqcn, child);
- }
-
- @Override
- public INode insertChildAt(String viewFqcn, int index) {
- if (index == -1) {
- return appendChild(viewFqcn);
- }
- Element child = mElement.getOwnerDocument().createElement(getTagName(viewFqcn));
- List<Element> children = DomUtilities.getChildren(mElement);
- if (children.size() >= index) {
- Element before = children.get(index);
- mElement.insertBefore(child, before);
- } else {
- fail("Unexpected index");
- mElement.appendChild(child);
- }
- return new TestXmlNode(viewFqcn, child);
- }
-
- @Override
- public String getStringAttr(String uri, String name) {
- String value;
- if (uri == null) {
- value = mElement.getAttribute(name);
- } else {
- value = mElement.getAttributeNS(uri, name);
- }
- if (value.isEmpty()) {
- value = null;
- }
-
- return value;
- }
-
- @Override
- public void removeChild(INode node) {
- assert node instanceof TestXmlNode;
- mElement.removeChild(((TestXmlNode) node).mElement);
- }
-
- @Override
- public void removeChild(int index) {
- List<Element> children = DomUtilities.getChildren(mElement);
- assertTrue(index < children.size());
- Element oldChild = children.get(index);
- mElement.removeChild(oldChild);
- }
- }
-
- public static class TestXmlAttribute implements IAttribute {
- private Attr mAttribute;
-
- public TestXmlAttribute(Attr attribute) {
- this.mAttribute = attribute;
- }
-
- @Override
- public String getUri() {
- return mAttribute.getNamespaceURI();
- }
-
- @Override
- public String getName() {
- String name = mAttribute.getLocalName();
- if (name == null) {
- name = mAttribute.getName();
- }
- return name;
- }
-
- @Override
- public String getValue() {
- return mAttribute.getValue();
- }
- }
-
- // Recursively initialize this node with the bounds specified in the given hierarchy
- // dump (from ViewHierarchy's DUMP_INFO flag
- public void assignBounds(String bounds) {
- Iterable<String> split = Splitter.on('\n').trimResults().split(bounds);
- assignBounds(split.iterator());
- }
-
- private void assignBounds(Iterator<String> iterator) {
- assertTrue(iterator.hasNext());
- String desc = iterator.next();
-
- Pattern pattern = Pattern.compile("^\\s*(.+)\\s+\\[(.+)\\]\\s*(<.+>)?\\s*(\\S+)?\\s*$");
- Matcher matcher = pattern.matcher(desc);
- assertTrue(matcher.matches());
- String fqn = matcher.group(1);
- assertEquals(getFqcn(), fqn);
- String boundsString = matcher.group(2);
- String[] bounds = boundsString.split(",");
- assertEquals(boundsString, 4, bounds.length);
- try {
- int left = Integer.parseInt(bounds[0]);
- int top = Integer.parseInt(bounds[1]);
- int right = Integer.parseInt(bounds[2]);
- int bottom = Integer.parseInt(bounds[3]);
- mBounds = new Rect(left, top, right - left, bottom - top);
- } catch (NumberFormatException nufe) {
- fail(nufe.getLocalizedMessage());
- }
- String tag = matcher.group(3);
-
- for (INode child : getChildren()) {
- assertTrue(iterator.hasNext());
- ((TestNode) child).assignBounds(iterator);
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java
deleted file mode 100644
index daa487ed4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.layout;
-
-import com.android.ide.common.api.DropFeedback;
-import com.android.ide.common.api.IDragElement;
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Rect;
-
-/** Test the {@link ZoomControlsRule} */
-public class ZoomControlsRuleTest extends LayoutTestBase {
- public void testDoNothing() {
- String draggedButtonId = "@+id/DraggedButton";
-
- IDragElement[] elements = TestDragElement.create(TestDragElement.create(
- "android.widget.Button").id(draggedButtonId));
-
- INode layout = TestNode.create("android.widget.ZoomControls").id("@+id/ZoomControls01")
- .bounds(new Rect(0, 0, 240, 480)).add(
- TestNode.create("android.widget.Button").id("@+id/Button01").bounds(
- new Rect(0, 0, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button02").bounds(
- new Rect(0, 100, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button03").bounds(
- new Rect(0, 200, 100, 80)),
- TestNode.create("android.widget.Button").id("@+id/Button04").bounds(
- new Rect(0, 300, 100, 80)));
-
- ZoomControlsRule rule = new ZoomControlsRule();
-
- // Enter target
- DropFeedback feedback = rule.onDropEnter(layout, null/*targetView*/, elements);
- // Zoom controls don't respond to drags
- assertNull(feedback);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/grid/GridModelTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/grid/GridModelTest.java
deleted file mode 100644
index c4a58c6e4..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/grid/GridModelTest.java
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
- * Copyright (C) 2011 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.common.layout.grid;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_COLUMN_COUNT;
-import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN;
-import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN_SPAN;
-import static com.android.SdkConstants.ATTR_LAYOUT_ROW;
-import static com.android.SdkConstants.FQCN_BUTTON;
-
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Rect;
-import com.android.ide.common.layout.LayoutTestBase;
-import com.android.ide.common.layout.TestNode;
-import com.android.ide.common.layout.grid.GridModel.ViewData;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-
-@SuppressWarnings("javadoc")
-public class GridModelTest extends LayoutTestBase {
- public void testRemoveFlag() {
- assertEquals("left", GridModel.removeFlag("top", "top|left"));
- assertEquals("left", GridModel.removeFlag("top", "top | left"));
- assertEquals("top", GridModel.removeFlag("left", "top|left"));
- assertEquals("top", GridModel.removeFlag("left", "top | left"));
- assertEquals("left | center", GridModel.removeFlag("top", "top | left | center"));
- assertEquals(null, GridModel.removeFlag("top", "top"));
- }
-
- public void testReadModel1() {
- TestNode targetNode = TestNode.create("android.widget.GridLayout").id("@+id/GridLayout1")
- .bounds(new Rect(0, 0, 240, 480)).set(ANDROID_URI, ATTR_COLUMN_COUNT, "3");
-
- GridModel model = GridModel.get(null, targetNode, null);
- assertEquals(3, model.declaredColumnCount);
- assertEquals(1, model.actualColumnCount);
- assertEquals(1, model.actualRowCount);
-
- targetNode.add(TestNode.create(FQCN_BUTTON).id("@+id/Button1"));
- targetNode.add(TestNode.create(FQCN_BUTTON).id("@+id/Button2"));
- targetNode.add(TestNode.create(FQCN_BUTTON).id("@+id/Button3"));
- targetNode.add(TestNode.create(FQCN_BUTTON).id("@+id/Button4"));
-
- model = GridModel.get(null, targetNode, null);
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
- }
-
- public void testSplitColumn() {
- TestNode targetNode = TestNode.create("android.widget.GridLayout").id("@+id/GridLayout1")
- .bounds(new Rect(0, 0, 240, 480)).set(ANDROID_URI, ATTR_COLUMN_COUNT, "3");
- TestNode b1 = TestNode.create(FQCN_BUTTON).id("@+id/Button1");
- TestNode b2 = TestNode.create(FQCN_BUTTON).id("@+id/Button2");
- TestNode b3 = TestNode.create(FQCN_BUTTON).id("@+id/Button3");
- TestNode b4 = TestNode.create(FQCN_BUTTON).id("@+id/Button4");
- targetNode.add(b1);
- targetNode.add(b2);
- targetNode.add(b3);
- targetNode.add(b4);
- b4.setAttribute(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN, "2");
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- model.applyPositionAttributes();
- assertEquals("0", b1.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("0", b1.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
-
- assertEquals("1", b2.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("0", b2.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
-
- assertEquals("2", b3.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("0", b3.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
-
- assertEquals("0", b4.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("1", b4.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
- assertEquals("2", b4.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
-
- model.splitColumn(1, false /*insertMarginColumn*/, 100 /*columnWidthDp*/, 300 /* x */);
- model.applyPositionAttributes();
-
- assertEquals(4, model.declaredColumnCount);
- assertEquals(4, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- assertEquals("0", b1.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("0", b1.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
-
- assertEquals("1", b2.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("2", b2.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
- assertEquals("0", b2.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
-
- assertEquals("3", b3.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("0", b3.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
-
- assertEquals("0", b4.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN));
- assertEquals("1", b4.getStringAttr(ANDROID_URI, ATTR_LAYOUT_ROW));
- assertEquals("3", b4.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
- }
-
- public void testDeletion1() {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"4\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <TextView\n" +
- " android:id=\"@+id/TextView1\"\n" +
- " android:layout_column=\"3\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Text\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/wspace1\"\n" +
- " android:layout_width=\"21dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/hspace1\"\n" +
- " android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"55dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/wspace2\"\n" +
- " android:layout_width=\"10dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"2\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- "</GridLayout>";
-
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode textView1 = TestNode.findById(targetNode, "@+id/TextView1");
- TestNode wspace1 = TestNode.findById(targetNode, "@+id/wspace1");
- TestNode wspace2 = TestNode.findById(targetNode, "@+id/wspace2");
- TestNode hspace1 = TestNode.findById(targetNode, "@+id/hspace1");
- assertNotNull(wspace1);
- assertNotNull(hspace1);
- assertNotNull(wspace2);
- assertNotNull(button1);
- assertNotNull(textView1);
-
- // Assign some bounds such that the model makes sense when merging spacer sizes
- // TODO: MAke test utility method to automatically assign half divisions!!
- button1.bounds(new Rect(90, 10, 100, 40));
- textView1.bounds(new Rect(200, 10, 100, 40));
- wspace1.bounds(new Rect(0, 0, 90, 1));
- wspace1.bounds(new Rect(190, 0, 10, 1));
- hspace1.bounds(new Rect(0, 0, 1, 10));
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(4, model.declaredColumnCount);
- assertEquals(4, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- ViewData textViewData = model.getView(textView1);
- assertEquals(3, textViewData.column);
-
- // Delete button1
- button1.getParent().removeChild(button1);
- model.onDeleted(Arrays.<INode>asList(button1));
- model.applyPositionAttributes();
-
- assertEquals(2, model.declaredColumnCount);
- assertEquals(2, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
- assertNotNull(model.getView(textView1));
- assertNull(model.getView(button1));
-
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"2\">\n" +
- "\n" +
- " <TextView\n" +
- " android:id=\"@+id/TextView1\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Text\">\n" +
- " </TextView>\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/wspace1\"\n" +
- " android:layout_width=\"66dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\">\n" +
- " </Space>\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/hspace1\"\n" +
- " android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"55dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\">\n" +
- " </Space>\n" +
- "\n" +
- "</GridLayout>", TestNode.toXml(targetNode));
-
- // Delete textView1
-
- textView1.getParent().removeChild(textView1);
- model.onDeleted(Arrays.<INode>asList(textView1));
- model.applyPositionAttributes();
-
- assertEquals(2, model.declaredColumnCount);
- assertEquals(0, model.actualColumnCount);
- assertEquals(0, model.actualRowCount);
- assertNull(model.getView(textView1));
- assertNull(model.getView(button1));
-
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"0\">\n" +
- "\n" +
- "</GridLayout>", TestNode.toXml(targetNode));
-
- }
-
- public void testDelete2() throws Exception {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"4\"\n" +
- " android:orientation=\"vertical\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_columnSpan=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"0\"\n" +
- " android:text=\"Button1\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_columnSpan=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button2\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_column=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"0\"\n" +
- " android:text=\"Button3\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_177\"\n" +
- " android:layout_width=\"46dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- "</GridLayout>";
-
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
- TestNode hspacer = TestNode.findById(targetNode, "@+id/spacer_177");
- assertNotNull(button1);
- assertNotNull(button2);
- assertNotNull(button3);
- assertNotNull(hspacer);
-
- // Assign some bounds such that the model makes sense when merging spacer sizes
- // TODO: MAke test utility method to automatically assign half divisions!!
- button1.bounds(new Rect(0, 0, 100, 40));
- button2.bounds(new Rect(100, 0, 100, 40));
- button3.bounds(new Rect(50, 40, 100, 40));
- hspacer.bounds(new Rect(0, 0, 50, 1));
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(4, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- ViewData buttonData = model.getView(button1);
- assertEquals(0, buttonData.column);
-
- // Delete button1
- button1.getParent().removeChild(button1);
- model.onDeleted(Arrays.<INode>asList(button1));
- model.applyPositionAttributes();
-
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
- assertNull(model.getView(button1));
-
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"3\"\n" +
- " android:orientation=\"vertical\">\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_columnSpan=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button2\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_column=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"0\"\n" +
- " android:text=\"Button3\">\n" +
- " </Button>\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_177\"\n" +
- " android:layout_width=\"46dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\">\n" +
- " </Space>\n" +
- "\n" +
- "</GridLayout>", TestNode.toXml(targetNode));
- }
-
- public void testDelete3_INCOMPLETE() throws Exception {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\" android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"6\">\n" +
- " <Button android:id=\"@+id/button1\" android:layout_column=\"1\"\n" +
- " android:layout_columnSpan=\"2\" android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\" android:layout_rowSpan=\"2\" android:text=\"Button\" />\n" +
- " <TextView android:id=\"@+id/TextView1\" android:layout_column=\"4\"\n" +
- " android:layout_gravity=\"left|top\" android:layout_row=\"1\"\n" +
- " android:text=\"Text\" />\n" +
- " <Button android:id=\"@+id/button3\" android:layout_column=\"5\"\n" +
- " android:layout_gravity=\"left|top\" android:layout_row=\"2\"\n" +
- " android:layout_rowSpan=\"2\" android:text=\"Button\" />\n" +
- " <Button android:id=\"@+id/button2\" android:layout_column=\"2\"\n" +
- " android:layout_columnSpan=\"3\" android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"4\" android:text=\"Button\" />\n" +
- " <Space android:id=\"@+id/wspace1\" android:layout_width=\"21dp\"\n" +
- " android:layout_height=\"1dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_630\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"55dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/wspace2\" android:layout_width=\"10dp\"\n" +
- " android:layout_height=\"1dp\" android:layout_column=\"3\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_619\" android:layout_width=\"59dp\"\n" +
- " android:layout_height=\"1dp\" android:layout_column=\"1\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_102\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"30dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"1\" />\n" +
- " <Space android:id=\"@+id/spacer_109\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"28dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"2\" />\n" +
- " <Space android:id=\"@+id/spacer_146\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"70dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"3\" />\n" +
- "</GridLayout>";
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
- targetNode.assignBounds(
- "android.widget.GridLayout [0,109,480,800] <GridLayout>\n" +
- " android.widget.Button [32,83,148,155] <Button> @+id/button1\n" +
- " android.widget.TextView [163,83,205,109] <TextView> @+id/TextView1\n" +
- " android.widget.Button [237,128,353,200] <Button> @+id/button3\n" +
- " android.widget.Button [121,275,237,347] <Button> @+id/button2\n" +
- " android.widget.Space [0,0,32,2] <Space> @+id/wspace1\n" +
- " android.widget.Space [0,0,2,83] <Space> @+id/spacer_630\n" +
- " android.widget.Space [148,0,163,2] <Space> @+id/wspace2\n" +
- " android.widget.Space [32,0,121,2] <Space> @+id/spacer_619\n" +
- " android.widget.Space [0,83,2,128] <Space> @+id/spacer_102\n" +
- " android.widget.Space [0,128,2,170] <Space> @+id/spacer_109\n" +
- " android.widget.Space [0,170,2,275] <Space> @+id/spacer_146\n");
- TestNode layout = TestNode.findById(targetNode, "@+id/GridLayout1");
- //TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(6, model.declaredColumnCount);
- assertEquals(6, model.actualColumnCount);
- assertEquals(5, model.actualRowCount);
-
- // TODO: Delete button2 or button3: bad stuff happens visually
- fail("Finish test");
- }
-
- public void testDelete4_INCOMPLETE() {
- String xml = "" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " xmlns:tools=\"http://schemas.android.com/tools\" " +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\" android:columnCount=\"3\"\n" +
- " android:gravity=\"center\" android:text=\"@string/hello_world\"\n" +
- " tools:context=\".MainActivity\">\n" +
- " <Button android:id=\"@+id/button2\" android:layout_column=\"1\"\n" +
- " android:layout_columnSpan=\"2\" android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\" android:text=\"Button\" />\n" +
- " <Button android:id=\"@+id/button1\" android:layout_column=\"1\"\n" +
- " android:layout_columnSpan=\"2\" android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"3\" android:text=\"Button\" />\n" +
- " <Space android:id=\"@+id/spacer_167\" android:layout_width=\"74dp\"\n" +
- " android:layout_height=\"1dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_133\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"21dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_142\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"26dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"2\" />\n" +
- " <Space android:id=\"@+id/spacer_673\" android:layout_width=\"43dp\"\n" +
- " android:layout_height=\"1dp\" android:layout_column=\"1\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_110\" android:layout_width=\"202dp\"\n" +
- " android:layout_height=\"15dp\" android:layout_column=\"2\" />\n" +
- "</GridLayout>";
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
- targetNode.assignBounds(
- "android.widget.GridLayout [0,109,480,800] <GridLayout>\n" +
- " android.widget.Button [111,32,227,104] <Button> @+id/button2\n" +
- " android.widget.Button [111,143,227,215] <Button> @+id/button1\n" +
- " android.widget.Space [0,0,111,2] <Space> @+id/spacer_167\n" +
- " android.widget.Space [0,0,2,32] <Space> @+id/spacer_133\n" +
- " android.widget.Space [0,104,2,143] <Space> @+id/spacer_142\n" +
- " android.widget.Space [111,0,176,2] <Space> @+id/spacer_673\n" +
- " android.widget.Space [176,668,479,691] <Space> @+id/spacer_110");
-
-
- // Remove button2; button1 shifts to the right!
-
- //TestNode layout = TestNode.findById(targetNode, "@+id/GridLayout1");
- //TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
- assertEquals(new Rect(111, 32, 227 - 111, 104 - 32), button2.getBounds());
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(4, model.actualRowCount);
- fail("Finish test");
- }
-
- public void testDelete5_INCOMPLETE() {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:id=\"@+id/GridLayout1\" android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\" android:columnCount=\"4\"\n" +
- " android:orientation=\"vertical\">\n" +
- " <Button android:id=\"@+id/button1\" android:layout_column=\"0\"\n" +
- " android:layout_gravity=\"center_horizontal|bottom\"\n" +
- " android:layout_row=\"0\" android:text=\"Button\" />\n" +
- " <Space android:layout_width=\"66dp\" android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\" android:layout_row=\"0\" />\n" +
- " <Button android:id=\"@+id/button3\" android:layout_column=\"2\"\n" +
- " android:layout_gravity=\"left|bottom\" android:layout_row=\"0\"\n" +
- " android:text=\"Button\" />\n" +
- " <Button android:id=\"@+id/button2\" android:layout_column=\"3\"\n" +
- " android:layout_columnSpan=\"2\" android:layout_gravity=\"left|bottom\"\n" +
- " android:layout_row=\"0\" android:text=\"Button\" />\n" +
- " <Space android:id=\"@+id/spacer_109\" android:layout_width=\"51dp\"\n" +
- " android:layout_height=\"1dp\" android:layout_column=\"1\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:layout_width=\"129dp\" android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"2\" android:layout_row=\"0\" />\n" +
- " <Space android:layout_width=\"62dp\" android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"3\" android:layout_row=\"0\" />\n" +
- " <Space android:id=\"@+id/spacer_397\" android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"103dp\" android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- " <Space android:layout_width=\"1dp\" android:layout_height=\"356dp\"\n" +
- " android:layout_column=\"0\" android:layout_row=\"1\" />\n" +
- "</GridLayout>";
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- targetNode.assignBounds(
- "android.widget.GridLayout [0,109,480,800] <GridLayout> @+id/GridLayout1\n" +
- " android.widget.Button [0,83,116,155] <Button> @+id/button1\n" +
- " android.widget.Space [0,0,99,2] <Space>\n" +
- " android.widget.Button [193,83,309,155] <Button> @+id/button3\n" +
- " android.widget.Button [387,83,503,155] <Button> @+id/button2\n" +
- " android.widget.Space [116,0,193,2] <Space> @+id/spacer_109\n" +
- " android.widget.Space [193,0,387,2] <Space>\n" +
- " android.widget.Space [387,0,480,2] <Space>\n" +
- " android.widget.Space [0,0,2,155] <Space> @+id/spacer_397\n" +
- " android.widget.Space [0,155,2,689] <Space>");
-
- // Delete button3. This causes an array out of bounds exception currently.
-
- //TestNode layout = TestNode.findById(targetNode, "@+id/GridLayout1");
- //TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
- assertEquals(new Rect(387, 83, 503 - 387, 155- 83), button2.getBounds());
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(4, model.declaredColumnCount);
- assertEquals(4, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- model.onDeleted(Collections.<INode>singletonList(button3));
- // Exception fixed; todo: Test that the model updates are correct.
-
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- fail("Finish test");
- }
-
- public void testInsert1() throws Exception {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:id=\"@+id/GridLayout1\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"4\"\n" +
- " android:orientation=\"vertical\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_columnSpan=\"4\"\n" +
- " android:layout_gravity=\"center_horizontal|bottom\"\n" +
- " android:layout_row=\"0\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_column=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_column=\"3\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_393\"\n" +
- " android:layout_width=\"81dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_397\"\n" +
- " android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"103dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- "</GridLayout>";
-
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode layout = TestNode.findById(targetNode, "@+id/GridLayout1");
- TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
- TestNode hspacer = TestNode.findById(targetNode, "@+id/spacer_393");
- TestNode vspacer = TestNode.findById(targetNode, "@+id/spacer_397");
- assertNotNull(layout);
- assertNotNull(button1);
- assertNotNull(button2);
- assertNotNull(button3);
- assertNotNull(hspacer);
-
- // Obtained by setting ViewHierarchy.DUMP_INFO=true:
- layout.bounds(new Rect(0, 109, 480, 800-109));
- button1.bounds(new Rect(182, 83, 298-182, 155-83));
- button2.bounds(new Rect(124, 155, 240-124, 227-155));
- button3.bounds(new Rect(240, 155, 356-240, 227-155));
- hspacer.bounds(new Rect(2, 0, 124-2, 2));
- vspacer.bounds(new Rect(0, 0, 2, 155));
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(4, model.declaredColumnCount);
- assertEquals(4, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
-
- model.splitColumn(1, false, 21, 32);
- int index = model.getInsertIndex(2, 1);
- GridModel.ViewData next = model.getView(index);
- INode newChild = targetNode.insertChildAt(FQCN_BUTTON, index);
- next.applyPositionAttributes();
- model.setGridAttribute(newChild, ATTR_LAYOUT_COLUMN, 1);
- model.setGridAttribute(newChild, ATTR_LAYOUT_COLUMN_SPAN, 3);
- }
-
- public void testInsert2() throws Exception {
- // Drop into a view where there is a centered view: when dropping to the right of
- // it (on a row further down), ensure that the row span is increased for the
- // non-left-justified centered view which does not horizontally overlap the view
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:id=\"@+id/GridLayout1\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"3\"\n" +
- " android:orientation=\"vertical\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_columnSpan=\"3\"\n" +
- " android:layout_gravity=\"center_horizontal|bottom\"\n" +
- " android:layout_row=\"0\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_column=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_393\"\n" +
- " android:layout_width=\"81dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " \n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_397\"\n" +
- " android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"103dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " \n" +
- "</GridLayout>";
-
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode layout = TestNode.findById(targetNode, "@+id/GridLayout1");
- TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
- TestNode hspacer = TestNode.findById(targetNode, "@+id/spacer_393");
- TestNode vspacer = TestNode.findById(targetNode, "@+id/spacer_397");
- assertNotNull(layout);
- assertNotNull(button1);
- assertNotNull(button2);
- assertNotNull(button3);
- assertNotNull(hspacer);
-
- // Obtained by setting ViewHierarchy.DUMP_INFO=true:
- layout.bounds(new Rect(0, 109, 480, 800-109));
- button1.bounds(new Rect(182, 83, 298-182, 155-83));
- button2.bounds(new Rect(122, 155, 238-122, 227-155));
- button3.bounds(new Rect(238, 155, 354-238, 227-155));
- hspacer.bounds(new Rect(0, 0, 122, 2));
- vspacer.bounds(new Rect(0, 0, 2, 155));
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- ViewData view = model.getView(button1);
- assertNotNull(view);
- assertEquals(0, view.column);
- assertEquals(3, view.columnSpan);
- assertEquals("3", view.node.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
-
- model.splitColumn(3, false, 53, 318);
- assertEquals(0, view.column);
- assertEquals(4, view.columnSpan);
- assertEquals("4", view.node.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
- }
-
- public void testInsert3_BROKEN() throws Exception {
- // Check that when we insert a new gap column near an existing column, the
- // view in that new column does not get moved
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<GridLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:id=\"@+id/GridLayout1\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:columnCount=\"3\"\n" +
- " android:orientation=\"vertical\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_columnSpan=\"3\"\n" +
- " android:layout_gravity=\"center_horizontal|bottom\"\n" +
- " android:layout_row=\"0\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_column=\"1\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_column=\"2\"\n" +
- " android:layout_gravity=\"left|top\"\n" +
- " android:layout_row=\"1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_393\"\n" +
- " android:layout_width=\"81dp\"\n" +
- " android:layout_height=\"1dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " \n" +
- " <Space\n" +
- " android:id=\"@+id/spacer_397\"\n" +
- " android:layout_width=\"1dp\"\n" +
- " android:layout_height=\"103dp\"\n" +
- " android:layout_column=\"0\"\n" +
- " android:layout_row=\"0\" />\n" +
- "\n" +
- " \n" +
- "</GridLayout>";
-
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode layout = TestNode.findById(targetNode, "@+id/GridLayout1");
- TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
- TestNode button3 = TestNode.findById(targetNode, "@+id/button3");
- TestNode hspacer = TestNode.findById(targetNode, "@+id/spacer_393");
- TestNode vspacer = TestNode.findById(targetNode, "@+id/spacer_397");
- assertNotNull(layout);
- assertNotNull(button1);
- assertNotNull(button2);
- assertNotNull(button3);
- assertNotNull(hspacer);
-
- // Obtained by setting ViewHierarchy.DUMP_INFO=true:
- layout.bounds(new Rect(0, 109, 480, 800-109));
- button1.bounds(new Rect(182, 83, 298-182, 155-83));
- button2.bounds(new Rect(122, 155, 238-122, 227-155));
- button3.bounds(new Rect(238, 155, 354-238, 227-155));
- hspacer.bounds(new Rect(0, 0, 122, 2));
- vspacer.bounds(new Rect(0, 0, 2, 155));
-
- GridModel model = GridModel.get(new LayoutTestBase.TestRulesEngine(targetNode.getFqcn()),
- targetNode, null);
- assertEquals(3, model.declaredColumnCount);
- assertEquals(3, model.actualColumnCount);
- assertEquals(2, model.actualRowCount);
-
- ViewData view = model.getView(button3);
- assertNotNull(view);
- assertEquals(2, view.column);
- assertEquals(1, view.columnSpan);
- assertNull("1", view.node.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
-
- model.splitColumn(2, true, 10, 253);
- // TODO: Finish this test: Assert that the cells are in the right place
- //assertEquals(4, view.column);
- //assertEquals(1, view.columnSpan);
- //assertEquals("4", view.node.getStringAttr(ANDROID_URI, ATTR_LAYOUT_COLUMN_SPAN));
- fail("Finish test");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/relative/DeletionHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/relative/DeletionHandlerTest.java
deleted file mode 100644
index d629a3897..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/relative/DeletionHandlerTest.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * 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.common.layout.relative;
-
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ANDROID_URI;
-
-import com.android.ide.common.api.INode;
-import com.android.ide.common.layout.BaseViewRule;
-import com.android.ide.common.layout.TestNode;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class DeletionHandlerTest extends TestCase {
- public void testSimple() {
- String xml = "" +
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignParentLeft=\"true\"\n" +
- " android:text=\"A\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button1\"\n" +
- " android:layout_alignBottom=\"@+id/button1\"\n" +
- " android:layout_toRightOf=\"@+id/button1\"\n" +
- " android:text=\"B\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button2\"\n" +
- " android:layout_toRightOf=\"@+id/button2\"\n" +
- " android:text=\"C\" />\n" +
- "\n" +
- "</RelativeLayout>";
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
-
- INode layout = button2.getParent();
- List<INode> deletedNodes = Collections.<INode>singletonList(button2);
- List<INode> movedNodes = Collections.<INode>emptyList();
- assertSame(layout, targetNode);
- layout.removeChild(button2);
-
- DeletionHandler handler = new DeletionHandler(deletedNodes, movedNodes, layout);
- handler.updateConstraints();
-
- String updated = TestNode.toXml(targetNode);
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\">\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignParentLeft=\"true\"\n" +
- " android:text=\"A\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button1\"\n" +
- " android:layout_alignBottom=\"@+id/button1\"\n" +
- " android:layout_toRightOf=\"@+id/button1\"\n" +
- " android:text=\"C\">\n" +
- " </Button>\n" +
- "\n" +
- "</RelativeLayout>",
- updated);
- assertFalse(updated.contains(BaseViewRule.stripIdPrefix(button2.getStringAttr(ANDROID_URI,
- ATTR_ID))));
- }
-
- public void testTransitive() {
- String xml = "" +
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\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=\"Above\" />\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_below=\"@+id/button1\"\n" +
- " android:text=\"A\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button2\"\n" +
- " android:layout_alignBottom=\"@+id/button2\"\n" +
- " android:layout_toRightOf=\"@+id/button2\"\n" +
- " android:text=\"B\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button4\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button3\"\n" +
- " android:layout_toRightOf=\"@+id/button3\"\n" +
- " android:text=\"C\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button5\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button4\"\n" +
- " android:layout_alignBottom=\"@+id/button4\"\n" +
- " android:layout_toRightOf=\"@+id/button4\"\n" +
- " android:text=\"D\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button6\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button5\"\n" +
- " android:layout_toRightOf=\"@+id/button5\"\n" +
- " android:text=\"E\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button7\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignLeft=\"@+id/button3\"\n" +
- " android:layout_below=\"@+id/button3\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <CheckBox\n" +
- " android:id=\"@+id/checkBox1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button7\"\n" +
- " android:layout_alignBottom=\"@+id/button7\"\n" +
- " android:layout_toRightOf=\"@+id/button7\"\n" +
- " android:text=\"CheckBox\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button8\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_below=\"@+id/checkBox1\"\n" +
- " android:layout_toRightOf=\"@+id/checkBox1\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- "</RelativeLayout>";
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
- TestNode button7 = TestNode.findById(targetNode, "@+id/button7");
- TestNode checkBox = TestNode.findById(targetNode, "@+id/checkBox1");
-
- INode layout = button7.getParent();
- List<INode> deletedNodes = Arrays.<INode>asList(button7, checkBox);
- List<INode> movedNodes = Collections.<INode>emptyList();
- assertSame(layout, targetNode);
- layout.removeChild(button7);
- layout.removeChild(checkBox);
-
- DeletionHandler handler = new DeletionHandler(deletedNodes, movedNodes, layout);
- handler.updateConstraints();
-
- String updated = TestNode.toXml(targetNode);
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\">\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\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=\"Above\">\n" +
- " </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_below=\"@+id/button1\"\n" +
- " android:text=\"A\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button2\"\n" +
- " android:layout_alignBottom=\"@+id/button2\"\n" +
- " android:layout_toRightOf=\"@+id/button2\"\n" +
- " android:text=\"B\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button4\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button3\"\n" +
- " android:layout_toRightOf=\"@+id/button3\"\n" +
- " android:text=\"C\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button5\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button4\"\n" +
- " android:layout_alignBottom=\"@+id/button4\"\n" +
- " android:layout_toRightOf=\"@+id/button4\"\n" +
- " android:text=\"D\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button6\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button5\"\n" +
- " android:layout_toRightOf=\"@+id/button5\"\n" +
- " android:text=\"E\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button8\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignLeft=\"@+id/button3\"\n" +
- " android:layout_below=\"@+id/button3\"\n" +
- " android:text=\"Button\">\n" +
- " </Button>\n" +
- "\n" +
- "</RelativeLayout>",
- updated);
- assertFalse(updated.contains(BaseViewRule.stripIdPrefix(button7.getStringAttr(ANDROID_URI,
- ATTR_ID))));
- }
-
- public void testCenter() {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_centerInParent=\"true\"\n" +
- " android:text=\"Button\" />\n" +
- "\n" +
- " <CheckBox\n" +
- " android:id=\"@+id/checkBox1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_below=\"@+id/button1\"\n" +
- " android:layout_toRightOf=\"@+id/button1\"\n" +
- " android:text=\"CheckBox\" />\n" +
- "\n" +
- "</RelativeLayout>";
-
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
- TestNode button1 = TestNode.findById(targetNode, "@+id/button1");
-
- INode layout = button1.getParent();
- List<INode> deletedNodes = Collections.<INode>singletonList(button1);
- List<INode> movedNodes = Collections.<INode>emptyList();
- assertSame(layout, targetNode);
- layout.removeChild(button1);
-
- DeletionHandler handler = new DeletionHandler(deletedNodes, movedNodes, layout);
- handler.updateConstraints();
-
- String updated = TestNode.toXml(targetNode);
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\">\n" +
- "\n" +
- " <CheckBox\n" +
- " android:id=\"@+id/checkBox1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_centerInParent=\"true\"\n" +
- " android:text=\"CheckBox\">\n" +
- " </CheckBox>\n" +
- "\n" +
- "</RelativeLayout>",
- updated);
- assertFalse(updated.contains(BaseViewRule.stripIdPrefix(button1.getStringAttr(ANDROID_URI,
- ATTR_ID))));
-
- }
-
- public void testMove() {
- String xml = "" +
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\" >\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignParentLeft=\"true\"\n" +
- " android:text=\"A\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button1\"\n" +
- " android:layout_alignBottom=\"@+id/button1\"\n" +
- " android:layout_toRightOf=\"@+id/button1\"\n" +
- " android:text=\"B\" />\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button2\"\n" +
- " android:layout_toRightOf=\"@+id/button2\"\n" +
- " android:text=\"C\" />\n" +
- "\n" +
- "</RelativeLayout>";
- TestNode targetNode = TestNode.createFromXml(xml);
- assertNotNull(targetNode);
-
- TestNode button2 = TestNode.findById(targetNode, "@+id/button2");
-
- INode layout = button2.getParent();
- List<INode> deletedNodes = Collections.<INode>singletonList(button2);
- List<INode> movedNodes = Collections.<INode>singletonList(button2);
- assertSame(layout, targetNode);
-
- DeletionHandler handler = new DeletionHandler(deletedNodes, movedNodes, layout);
- handler.updateConstraints();
-
- String updated = TestNode.toXml(targetNode);
- assertEquals(
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<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:ignore=\"HardcodedText\">\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignParentLeft=\"true\"\n" +
- " android:text=\"A\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button2\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBaseline=\"@+id/button1\"\n" +
- " android:layout_alignBottom=\"@+id/button1\"\n" +
- " android:layout_toRightOf=\"@+id/button1\"\n" +
- " android:text=\"B\">\n" +
- " </Button>\n" +
- "\n" +
- " <Button\n" +
- " android:id=\"@+id/button3\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignBottom=\"@+id/button2\"\n" +
- " android:layout_toRightOf=\"@+id/button2\"\n" +
- " android:text=\"C\">\n" +
- " </Button>\n" +
- "\n" +
- "</RelativeLayout>",
- updated);
- assertTrue(updated.contains(BaseViewRule.stripIdPrefix(button2.getStringAttr(ANDROID_URI,
- ATTR_ID))));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java
deleted file mode 100644
index b56292245..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * 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.common.resources.platform;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.DOT_XML;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.ide.common.api.IAttributeInfo.Format;
-import com.android.ide.common.resources.ResourceItem;
-import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
-import com.android.ide.eclipse.mock.Mocks;
-import com.android.io.IAbstractFolder;
-import com.android.io.IAbstractResource;
-import com.android.resources.ResourceType;
-import com.android.utils.StdLogger;
-import com.google.common.base.Charsets;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-import com.google.common.io.Files;
-
-import junit.framework.TestCase;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.Map;
-import java.util.Set;
-
-@SuppressWarnings("javadoc")
-public class AttributeInfoTest extends TestCase {
- public void testSimple() throws Exception {
- AttributeInfo info = new AttributeInfo("test", EnumSet.noneOf(Format.class));
- assertTrue(info.isValid("", null, null));
- assertTrue(info.isValid("a b c", null, null));
- assertTrue(info.isValid("@android foo bar", null, null));
- }
-
- public void testIsValidString() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.STRING_SET);
- assertTrue(info.isValid("", null, null));
- assertTrue(info.isValid("a b c", null, null));
- assertTrue(info.isValid("@android foo bar", null, null));
- }
-
- public void testIsValidBoolean() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.BOOLEAN_SET);
- assertTrue(info.isValid("true", null, null));
- assertTrue(info.isValid("false", null, null));
- assertFalse(info.isValid("", null, null));
- assertTrue(info.isValid("TRUE", null, null));
- assertTrue(info.isValid("True", null, null));
- assertTrue(info.isValid("FALSE", null, null));
- assertTrue(info.isValid("False", null, null));
- }
-
- public void testIsValidInteger() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.INTEGER_SET);
- assertTrue(info.isValid("0", null, null));
- assertTrue(info.isValid("1", null, null));
- assertTrue(info.isValid("10", null, null));
- assertTrue(info.isValid("-10", null, null));
- assertTrue(info.isValid(Integer.toString(Integer.MAX_VALUE), null, null));
-
- assertFalse(info.isValid("", null, null));
- assertFalse(info.isValid("a", null, null));
- assertFalse(info.isValid("a1", null, null));
- assertFalse(info.isValid("1a", null, null));
- assertFalse(info.isValid("1.0", null, null));
- }
-
- public void testIsValidFloat() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.FLOAT_SET);
- assertTrue(info.isValid("0", null, null));
- assertTrue(info.isValid("1", null, null));
- assertTrue(info.isValid("10", null, null));
- assertTrue(info.isValid("-10", null, null));
- assertTrue(info.isValid("-10.1234", null, null));
- assertTrue(info.isValid(".1", null, null));
- assertTrue(info.isValid("-.1", null, null));
- assertTrue(info.isValid("1.5e22", null, null));
- assertTrue(info.isValid(Integer.toString(Integer.MAX_VALUE), null, null));
-
- assertFalse(info.isValid("", null, null));
- assertFalse(info.isValid(".", null, null));
- assertFalse(info.isValid("-.", null, null));
- assertFalse(info.isValid("a", null, null));
- assertFalse(info.isValid("a1", null, null));
- assertFalse(info.isValid("1a", null, null));
- }
-
- public void testIsValidDimension() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.DIMENSION_SET);
- assertTrue(info.isValid("0dp", null, null));
- assertTrue(info.isValid("1dp", null, null));
- assertTrue(info.isValid("10dip", null, null));
- assertTrue(info.isValid("-10px", null, null));
- assertTrue(info.isValid("-10.1234mm", null, null));
- assertTrue(info.isValid("14sp", null, null));
- assertTrue(info.isValid("72pt", null, null));
-
- assertFalse(info.isValid("", null, null));
- assertFalse(info.isValid("5", null, null));
- assertFalse(info.isValid("50ps", null, null));
- // Since we allow resources even when not specified in format, don't assert
- // this:
- //assertFalse(info.isValid("@dimen/foo"));
- }
-
- public void testIsValidColor() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.COLOR_SET);
- assertTrue(info.isValid("#fff", null, null));
- assertTrue(info.isValid("#ffffff", null, null));
- assertTrue(info.isValid("#12345678", null, null));
- assertTrue(info.isValid("#abcdef00", null, null));
-
- assertFalse(info.isValid("", null, null));
- assertFalse(info.isValid("#fffffffff", null, null));
- assertFalse(info.isValid("red", null, null));
- assertFalse(info.isValid("rgb(1,2,3)", null, null));
- }
-
- public void testIsValidFraction() throws Exception {
- AttributeInfo info = new AttributeInfo("test", EnumSet.<Format>of(Format.FRACTION));
- assertTrue(info.isValid("5%", null, null));
- assertTrue(info.isValid("25%p", null, null));
-
- // We don't validate fractions accurately yet
- //assertFalse(info.isValid(""));
- //assertFalse(info.isValid("50%%"));
- //assertFalse(info.isValid("50"));
- //assertFalse(info.isValid("-2%"));
- }
-
- public void testIsValidReference() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.REFERENCE_SET);
- assertTrue(info.isValid("@android:string/foo", null, null));
- assertTrue(info.isValid("@string/foo", null, null));
- assertTrue(info.isValid("@dimen/foo", null, null));
- assertTrue(info.isValid("@color/foo", null, null));
- assertTrue(info.isValid("@animator/foo", null, null));
- assertTrue(info.isValid("@anim/foo", null, null));
- assertTrue(info.isValid("?android:attr/textAppearanceMedium", null, null));
- assertTrue(info.isValid("?textAppearanceMedium", null, null));
-
- assertFalse(info.isValid("", null, null));
- assertFalse(info.isValid("foo", null, null));
- assertFalse(info.isValid("3.4", null, null));
- }
-
- public void testIsValidEnum() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.ENUM_SET);
- info.setEnumValues(new String[] { "wrap_content", "match_parent" });
- assertTrue(info.isValid("wrap_content", null, null));
- assertTrue(info.isValid("match_parent", null, null));
- assertFalse(info.isValid("", null, null));
- assertFalse(info.isValid("other", null, null));
- assertFalse(info.isValid("50", null, null));
- }
-
- public void testIsValidFlag() throws Exception {
- AttributeInfo info = new AttributeInfo("test", Format.FLAG_SET);
- info.setFlagValues(new String[] { "left", "top", "right", "bottom" });
- assertTrue(info.isValid("left", null, null));
- assertTrue(info.isValid("top", null, null));
- assertTrue(info.isValid("left|top", null, null));
- assertTrue(info.isValid("", null, null));
-
- assertFalse(info.isValid("other", null, null));
- assertFalse(info.isValid("50", null, null));
- }
-
- public void testCombined1() throws Exception {
- AttributeInfo info = new AttributeInfo("test", EnumSet.<Format>of(Format.INTEGER,
- Format.REFERENCE));
- assertTrue(info.isValid("1", null, null));
- assertTrue(info.isValid("@dimen/foo", null, null));
- assertFalse(info.isValid("foo", null, null));
- }
-
- public void testCombined2() throws Exception {
- AttributeInfo info = new AttributeInfo("test", EnumSet.<Format>of(Format.COLOR,
- Format.REFERENCE));
- assertTrue(info.isValid("#ff00ff00", null, null));
- assertTrue(info.isValid("@color/foo", null, null));
- assertFalse(info.isValid("foo", null, null));
- }
-
- public void testCombined3() throws Exception {
- AttributeInfo info = new AttributeInfo("test", EnumSet.<Format>of(Format.STRING,
- Format.REFERENCE));
- assertTrue(info.isValid("test", null, null));
- assertTrue(info.isValid("@color/foo", null, null));
- }
-
- public void testCombined4() throws Exception {
- AttributeInfo info = new AttributeInfo("test", EnumSet.<Format>of(Format.ENUM,
- Format.DIMENSION));
- info.setEnumValues(new String[] { "wrap_content", "match_parent" });
- assertTrue(info.isValid("wrap_content", null, null));
- assertTrue(info.isValid("match_parent", null, null));
- assertTrue(info.isValid("50dp", null, null));
- assertFalse(info.isValid("50", null, null));
- assertFalse(info.isValid("test", null, null));
- }
-
- public void testResourcesExist() throws Exception {
- IAbstractFolder folder = Mocks.createAbstractFolder(
- SdkConstants.FD_RESOURCES, new IAbstractResource[0]);
-
- AttributeInfo info = new AttributeInfo("test", Format.REFERENCE_SET);
- TestResourceRepository projectResources = new TestResourceRepository(folder,false);
- projectResources.addResource(ResourceType.STRING, "mystring");
- projectResources.addResource(ResourceType.DIMEN, "mydimen");
- TestResourceRepository frameworkResources = new TestResourceRepository(folder, true);
- frameworkResources.addResource(ResourceType.LAYOUT, "mylayout");
-
- assertTrue(info.isValid("@string/mystring", null, null));
- assertTrue(info.isValid("@dimen/mydimen", null, null));
- assertTrue(info.isValid("@android:layout/mylayout", null, null));
- assertTrue(info.isValid("?android:attr/listPreferredItemHeigh", null, null));
-
- assertTrue(info.isValid("@string/mystring", projectResources, frameworkResources));
- assertTrue(info.isValid("@dimen/mydimen", projectResources, frameworkResources));
- assertTrue(info.isValid("@android:layout/mylayout", projectResources, frameworkResources));
-
- assertFalse(info.isValid("@android:string/mystring", projectResources,
- frameworkResources));
- assertFalse(info.isValid("@android:dimen/mydimen", projectResources, frameworkResources));
- assertFalse(info.isValid("@layout/mylayout", projectResources, frameworkResources));
- assertFalse(info.isValid("@layout/foo", projectResources, frameworkResources));
- assertFalse(info.isValid("@anim/foo", projectResources, frameworkResources));
- assertFalse(info.isValid("@android:anim/foo", projectResources, frameworkResources));
- }
-
- private class TestResourceRepository extends ResourceRepository {
- private Multimap<ResourceType, String> mResources = ArrayListMultimap.create();
-
- protected TestResourceRepository(IAbstractFolder resFolder, boolean isFrameworkRepository) {
- super(resFolder, isFrameworkRepository);
- }
-
- void addResource(ResourceType type, String name) {
- mResources.put(type, name);
- }
-
- @Override
- @NonNull
- protected ResourceItem createResourceItem(@NonNull String name) {
- fail("Not used in test");
- return null;
- }
-
- @Override
- public boolean hasResourceItem(@NonNull ResourceType type, @NonNull String name) {
- Collection<String> names = mResources.get(type);
- if (names != null) {
- return names.contains(name);
- }
-
- return false;
- }
- };
-
-
- public void testIsValid() throws Exception {
- // This test loads the full attrs.xml file and then processes a bunch of platform
- // resource file and makes sure that they're all considered valid. This helps
- // make sure that isValid() closely matches what aapt accepts.
- String sdkPath = System.getenv("ADT_SDK_SOURCE_PATH");
- assertNotNull("This test requires ADT_SDK_SOURCE_PATH to be set to point to the" +
- "SDK git repository", sdkPath);
- File sdk = new File(sdkPath);
- assertNotNull("$ADT_SDK_SOURCE_PATH (" + sdk.getPath() + ") is not a directory",
- sdk.isDirectory());
- File git = sdk.getParentFile();
- File attrsPath = new File(git, "frameworks" + File.separator + "base"
- + File.separator + "core" + File.separator + "res" + File.separator + "res"
- + File.separator + "values" + File.separator + "attrs.xml");
- assertTrue(attrsPath.getPath(), attrsPath.exists());
- AttrsXmlParser parser = new AttrsXmlParser(attrsPath.getPath(),
- new StdLogger(StdLogger.Level.VERBOSE), 1100);
- parser.preload();
- Map<String, AttributeInfo> attributeMap = parser.getAttributeMap();
- assertNotNull(attributeMap);
- assertNotNull(attributeMap.get("layout_width"));
- Set<String> seen = Sets.newHashSet();
-
- checkDir(new File(git, "packages" + File.separator + "apps"), false, attributeMap, seen);
- }
-
- private void checkDir(File dir, boolean isResourceDir,
- Map<String, AttributeInfo> map, Set<String> seen) throws IOException {
- assertTrue(dir.isDirectory());
- File[] list = dir.listFiles();
- if (list != null) {
- for (File file : list) {
- if (isResourceDir && file.isFile() && file.getPath().endsWith(DOT_XML)) {
- checkXmlFile(file, map, seen);
- } else if (file.isDirectory()) {
- checkDir(file, isResourceDir || file.getName().equals("res"), map, seen);
- }
- }
- }
- }
-
- private void checkXmlFile(File file, Map<String, AttributeInfo> map,
- Set<String> seen) throws IOException {
- String xml = Files.toString(file, Charsets.UTF_8);
- if (xml != null) {
- //Document doc = DomUtilities.parseStructuredDocument(xml);
- Document doc = DomUtilities.parseDocument(xml, false);
- if (doc != null && doc.getDocumentElement() != null) {
- checkElement(file, doc.getDocumentElement(), map, seen);
- }
- }
- }
-
- private void checkElement(File file, Element element, Map<String, AttributeInfo> map,
- Set<String> seen) {
- NamedNodeMap attributes = element.getAttributes();
- for (int i = 0, n = attributes.getLength(); i < n; i++) {
- Attr attribute = (Attr) attributes.item(i);
-
- String uri = attribute.getNamespaceURI();
- String name = attribute.getLocalName();
- String value = attribute.getValue();
- if (ANDROID_URI.equals(uri)) {
- AttributeInfo info = map.get(name);
- if (info == null) {
- System.out.println("Warning: Unknown attribute '" + name + "' in " + file);
- return;
- }
- if (!info.isValid(value, null, null)) {
- if (name.equals("duration") || name.equals("exitFadeDuration")) {
- // Already known
- return;
- }
- String message = "In file " +
- file.getPath() + ":\nCould not validate value \"" + value
- + "\" for attribute '"
- + name + "' where the attribute info has formats " + info.getFormats()
- + "\n";
- System.out.println("\n" + message);
- fail(message);
- }
- if ((value.startsWith("@") || value.startsWith("?")) &&
- !info.getFormats().contains(Format.REFERENCE)) {
- // Print out errors in attrs.xml
-
- if (!seen.contains(name)) {
- seen.add(name);
- System.out.println("\"" + name + "\" with formats " + info.getFormats()
- + " was passed a reference (" + value + ") in file " + file);
- }
- }
- }
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserManifestTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserManifestTest.java
deleted file mode 100755
index 82d6acafb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserManifestTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2010 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.common.resources.platform;
-
-import com.android.ide.eclipse.mock.TestLogger;
-import com.android.ide.eclipse.tests.AdtTestData;
-
-import java.util.Arrays;
-import java.util.Map;
-import java.util.TreeMap;
-
-import junit.framework.TestCase;
-
-public class AttrsXmlParserManifestTest extends TestCase {
-
- private AttrsXmlParser mParser;
- private String mFilePath;
-
- private static final String MOCK_DATA_PATH =
- "com/android/ide/eclipse/testdata/mock_manifest_attrs.xml"; //$NON-NLS-1$
-
- @Override
- public void setUp() throws Exception {
- mFilePath = AdtTestData.getInstance().getTestFilePath(MOCK_DATA_PATH);
- mParser = new AttrsXmlParser(mFilePath, new TestLogger(), 100);
- }
-
- @Override
- public void tearDown() throws Exception {
- }
-
- public void testGetOsAttrsXmlPath() throws Exception {
- assertEquals(mFilePath, mParser.getOsAttrsXmlPath());
- }
-
- private Map<String, DeclareStyleableInfo> preloadAndGetStyleables() {
- assertSame(mParser, mParser.preload());
-
- Map<String, DeclareStyleableInfo> styleableList = mParser.getDeclareStyleableList();
- // For testing purposes, we want the strings sorted
- if (!(styleableList instanceof TreeMap<?, ?>)) {
- styleableList = new TreeMap<String, DeclareStyleableInfo>(styleableList);
- }
- return styleableList;
- }
-
- public final void testPreload() throws Exception {
- Map<String, DeclareStyleableInfo> styleableList = preloadAndGetStyleables();
-
- assertEquals(
- "[AndroidManifest, " +
- "AndroidManifestActivityAlias, " +
- "AndroidManifestApplication, " +
- "AndroidManifestNewElement, " +
- "AndroidManifestNewParent, " +
- "AndroidManifestPermission" +
- "]",
- Arrays.toString(styleableList.keySet().toArray()));
- }
-
- /**
- * Tests that AndroidManifestNewParentNewElement got renamed to AndroidManifestNewElement
- * and a parent named AndroidManifestNewParent was automatically created.
- */
- public final void testNewParent() throws Exception {
- Map<String, DeclareStyleableInfo> styleableList = preloadAndGetStyleables();
-
- DeclareStyleableInfo newElement = styleableList.get("AndroidManifestNewElement");
- assertNotNull(newElement);
- assertEquals("AndroidManifestNewElement", newElement.getStyleName());
- assertEquals("[AndroidManifestNewParent]",
- Arrays.toString(newElement.getParents()));
-
- DeclareStyleableInfo newParent = styleableList.get("AndroidManifestNewParent");
- assertNotNull(newParent);
- assertEquals("[AndroidManifest]",
- Arrays.toString(newParent.getParents()));
-
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserTest.java
deleted file mode 100644
index 883577b8a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttrsXmlParserTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2008 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.common.resources.platform;
-
-
-import com.android.ide.common.api.IAttributeInfo.Format;
-import com.android.ide.eclipse.mock.TestLogger;
-import com.android.ide.eclipse.tests.AdtTestData;
-
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-public class AttrsXmlParserTest extends TestCase {
-
- private AttrsXmlParser mParser;
- private String mFilePath;
-
- private static final String MOCK_DATA_PATH =
- "com/android/ide/eclipse/testdata/mock_attrs.xml"; //$NON-NLS-1$
-
- @Override
- public void setUp() throws Exception {
- mFilePath = AdtTestData.getInstance().getTestFilePath(MOCK_DATA_PATH);
- mParser = new AttrsXmlParser(mFilePath, new TestLogger(), 100);
- }
-
- @Override
- public void tearDown() throws Exception {
- }
-
- public void testGetOsAttrsXmlPath() throws Exception {
- assertEquals(mFilePath, mParser.getOsAttrsXmlPath());
- }
-
- public final void testPreload() throws Exception {
- assertSame(mParser, mParser.preload());
- }
-
-
- public final void testLoadViewAttributes() throws Exception {
- mParser.preload();
- ViewClassInfo info = new ViewClassInfo(
- false /* isLayout */,
- "mock_android.something.Theme", //$NON-NLS-1$
- "Theme"); //$NON-NLS-1$
- mParser.loadViewAttributes(info);
-
- assertEquals("These are the standard attributes that make up a complete theme.", //$NON-NLS-1$
- info.getJavaDoc());
- AttributeInfo[] attrs = info.getAttributes();
- assertEquals(1, attrs.length);
- assertEquals("scrollbarSize", info.getAttributes()[0].getName());
- assertEquals(1, info.getAttributes()[0].getFormats().size());
- assertEquals(Format.DIMENSION, info.getAttributes()[0].getFormats().iterator().next());
- }
-
- public final void testEnumFlagValues() throws Exception {
- /* The XML being read contains:
- <!-- Standard orientation constant. -->
- <attr name="orientation">
- <!-- Defines an horizontal widget. -->
- <enum name="horizontal" value="0" />
- <!-- Defines a vertical widget. -->
- <enum name="vertical" value="1" />
- </attr>
- */
-
- mParser.preload();
- Map<String, Map<String, Integer>> attrMap = mParser.getEnumFlagValues();
- assertTrue(attrMap.containsKey("orientation"));
-
- Map<String, Integer> valueMap = attrMap.get("orientation");
- assertTrue(valueMap.containsKey("horizontal"));
- assertTrue(valueMap.containsKey("vertical"));
- assertEquals(Integer.valueOf(0), valueMap.get("horizontal"));
- assertEquals(Integer.valueOf(1), valueMap.get("vertical"));
- }
-
- public final void testDeprecated() throws Exception {
- mParser.preload();
-
- DeclareStyleableInfo dep = mParser.getDeclareStyleableList().get("DeprecatedTest");
- assertNotNull(dep);
-
- AttributeInfo[] attrs = dep.getAttributes();
- assertEquals(4, attrs.length);
-
- assertEquals("deprecated-inline", attrs[0].getName());
- assertEquals("In-line deprecated.", attrs[0].getDeprecatedDoc());
- assertEquals("Deprecated comments using delimiters.", attrs[0].getJavaDoc());
-
- assertEquals("deprecated-multiline", attrs[1].getName());
- assertEquals("Multi-line version of deprecated that works till the next tag.",
- attrs[1].getDeprecatedDoc());
- assertEquals("Deprecated comments on their own line.", attrs[1].getJavaDoc());
-
- assertEquals("deprecated-not", attrs[2].getName());
- assertEquals(null, attrs[2].getDeprecatedDoc());
- assertEquals("This attribute is not deprecated.", attrs[2].getJavaDoc());
-
- assertEquals("deprecated-no-javadoc", attrs[3].getName());
- assertEquals("There is no other javadoc here.", attrs[3].getDeprecatedDoc());
- assertEquals("", attrs[3].getJavaDoc());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtPluginTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtPluginTest.java
deleted file mode 100644
index e198c6e4b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtPluginTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-import java.io.File;
-import java.io.StringReader;
-
-import junit.framework.TestCase;
-
-public class AdtPluginTest extends TestCase {
- public void testReaderContains() throws Exception {
- String input = "this is a test";
- assertFalse(AdtPlugin.streamContains(new StringReader(input), "hello"));
- assertTrue(AdtPlugin.streamContains(new StringReader(input), "this"));
- assertFalse(AdtPlugin.streamContains(new StringReader(input), "thiss"));
- assertTrue(AdtPlugin.streamContains(new StringReader(input), "is a"));
- assertTrue(AdtPlugin.streamContains(new StringReader("ABC ABCDAB ABCDABCDABDE"),
- "ABCDABD"));
- assertFalse(AdtPlugin.streamContains(new StringReader("ABC ABCDAB ABCDABCDABDE"),
- "ABCEABD"));
- }
-
- public void testReadStream() throws Exception {
- String input = "this is a test";
- String contents = AdtPlugin.readFile(new StringReader(input));
- assertEquals(input, contents);
- }
-
- public void testReadWriteFile() throws Exception {
- File temp = File.createTempFile("test", ".txt");
- String myContent = "this is\na test";
- AdtPlugin.writeFile(temp, myContent);
- String readBack = AdtPlugin.readFile(temp);
- assertEquals(myContent, readBack);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtUtilsTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtUtilsTest.java
deleted file mode 100644
index c1e94ac69..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/AdtUtilsTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2011 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;
-
-import junit.framework.TestCase;
-
-import java.util.Locale;
-
-@SuppressWarnings("javadoc")
-public class AdtUtilsTest extends TestCase {
- public void testExtractClassName() {
- assertEquals("Foo", AdtUtils.extractClassName("foo"));
- assertEquals("Foobar", AdtUtils.extractClassName("foo bar"));
- assertEquals("JavasTypeSystem", AdtUtils.extractClassName("Java's Type System"));
- assertEquals("Foo", AdtUtils.extractClassName("1foo "));
- }
-
- public void testStripAllExtensions() {
- assertEquals("", AdtUtils.stripAllExtensions(""));
- assertEquals("foobar", AdtUtils.stripAllExtensions("foobar"));
- assertEquals("foobar", AdtUtils.stripAllExtensions("foobar.png"));
- assertEquals("foobar", AdtUtils.stripAllExtensions("foobar.9.png"));
- assertEquals(".profile", AdtUtils.stripAllExtensions(".profile"));
- }
-
- public void testStripLastExtension() {
- assertEquals("", AdtUtils.stripLastExtension(""));
- assertEquals("foobar", AdtUtils.stripLastExtension("foobar"));
- assertEquals("foobar", AdtUtils.stripLastExtension("foobar.png"));
- assertEquals("foobar.9", AdtUtils.stripLastExtension("foobar.9.png"));
- assertEquals(".profile", AdtUtils.stripLastExtension(".profile"));
- }
-
- public void testCapitalize() {
- assertEquals("UPPER", AdtUtils.capitalize("UPPER"));
- assertEquals("Lower", AdtUtils.capitalize("lower"));
- assertEquals("Capital", AdtUtils.capitalize("Capital"));
- assertEquals("CamelCase", AdtUtils.capitalize("camelCase"));
- assertEquals("", AdtUtils.capitalize(""));
- assertSame("Foo", AdtUtils.capitalize("Foo"));
- assertNull(null, AdtUtils.capitalize(null));
- }
-
- public void testCamelCaseToUnderlines() {
- assertEquals("", AdtUtils.camelCaseToUnderlines(""));
- assertEquals("foo", AdtUtils.camelCaseToUnderlines("foo"));
- assertEquals("foo", AdtUtils.camelCaseToUnderlines("Foo"));
- assertEquals("foo_bar", AdtUtils.camelCaseToUnderlines("FooBar"));
- assertEquals("test_xml", AdtUtils.camelCaseToUnderlines("testXML"));
- assertEquals("test_foo", AdtUtils.camelCaseToUnderlines("testFoo"));
- }
-
- public void testUnderlinesToCamelCase() {
- assertEquals("", AdtUtils.underlinesToCamelCase(""));
- assertEquals("", AdtUtils.underlinesToCamelCase("_"));
- assertEquals("Foo", AdtUtils.underlinesToCamelCase("foo"));
- assertEquals("FooBar", AdtUtils.underlinesToCamelCase("foo_bar"));
- assertEquals("FooBar", AdtUtils.underlinesToCamelCase("foo__bar"));
- assertEquals("Foo", AdtUtils.underlinesToCamelCase("foo_"));
- }
-
- public void testStripSuffix() {
- assertEquals("Foo", AdtUtils.stripSuffix("Foo", ""));
- assertEquals("Fo", AdtUtils.stripSuffix("Foo", "o"));
- assertEquals("F", AdtUtils.stripSuffix("Fo", "o"));
- assertEquals("", AdtUtils.stripSuffix("Foo", "Foo"));
- assertEquals("LinearLayout_Layout",
- AdtUtils.stripSuffix("LinearLayout_LayoutParams", "Params"));
- assertEquals("Foo", AdtUtils.stripSuffix("Foo", "Bar"));
- }
-
- public void testFormatFloatValue() throws Exception {
- assertEquals("1", AdtUtils.formatFloatAttribute(1.0f));
- assertEquals("2", AdtUtils.formatFloatAttribute(2.0f));
- assertEquals("1.50", AdtUtils.formatFloatAttribute(1.5f));
- assertEquals("1.50", AdtUtils.formatFloatAttribute(1.50f));
- assertEquals("1.51", AdtUtils.formatFloatAttribute(1.51f));
- assertEquals("1.51", AdtUtils.formatFloatAttribute(1.514542f));
- assertEquals("1.52", AdtUtils.formatFloatAttribute(1.516542f));
- assertEquals("-1.51", AdtUtils.formatFloatAttribute(-1.51f));
- assertEquals("-1", AdtUtils.formatFloatAttribute(-1f));
- }
-
- public void testFormatFloatValueLocale() throws Exception {
- // Ensure that the layout float values aren't affected by
- // locale settings, like using commas instead of of periods
- Locale originalDefaultLocale = Locale.getDefault();
-
- try {
- Locale.setDefault(Locale.FRENCH);
-
- // Ensure that this is a locale which uses a comma instead of a period:
- assertEquals("5,24", String.format("%.2f", 5.236f));
-
- // Ensure that the formatFloatAttribute is immune
- assertEquals("1.50", AdtUtils.formatFloatAttribute(1.5f));
- } finally {
- Locale.setDefault(originalDefaultLocale);
- }
- }
-
- public void testEscapeUnicodeChars() throws Exception {
- assertEquals("", AdtUtils.replaceUnicodeEscapes(""));
- assertEquals("foo bar", AdtUtils.replaceUnicodeEscapes("foo bar"));
- assertEquals("\u25C0", AdtUtils.replaceUnicodeEscapes("\\u25C0"));
- assertEquals("!\u25C0\u25C1!", AdtUtils.replaceUnicodeEscapes("!\\u25C0\\u25C1!"));
- assertEquals("\u1234\\", AdtUtils.replaceUnicodeEscapes("\\u1234\\"));
-
- assertEquals("\\U25C0", AdtUtils.replaceUnicodeEscapes("\\U25C0")); // no unicode expand
- assertEquals("\\u25C", AdtUtils.replaceUnicodeEscapes("\\u25C")); // no unicode expand
- assertEquals("\\\\u25C0", AdtUtils.replaceUnicodeEscapes("\\\\u25C0")); // escaped
- assertEquals("\\u123\\", AdtUtils.replaceUnicodeEscapes("\\u123\\")); // broken
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/build/BaseBuilderTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/build/BaseBuilderTest.java
deleted file mode 100644
index a1d658b97..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/build/BaseBuilderTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 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.build;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import junit.framework.TestCase;
-
-public class BaseBuilderTest extends TestCase {
-
- public void testParseAaptOutput() {
- Pattern p = Pattern.compile( "^(.+):(\\d+):\\s(.+)$"); //$NON-NLS-1$
- String s = "C:\\java\\workspace-android\\AndroidApp\\res\\values\\strings.xml:11: WARNING: empty 'some warning text";
-
- Matcher m = p.matcher(s);
- assertEquals(true, m.matches());
- assertEquals("C:\\java\\workspace-android\\AndroidApp\\res\\values\\strings.xml", m.group(1));
- assertEquals("11", m.group(2));
- assertEquals("WARNING: empty 'some warning text", m.group(3));
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java
deleted file mode 100644
index 3c0805a34..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.editors;
-
-import org.eclipse.swt.graphics.Point;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class AndroidDoubleClickStrategyTest extends TestCase {
- public void test_getWord_plain() throws Exception {
- checkWord("^foo", "[foo]");
- checkWord("'fo^o'", "'[foo]'");
- checkWord("\"foo^\"", "\"[foo]\"");
- }
-
- public void test_getWord_resources() throws Exception {
- checkWord("'@and^roid:string/ok'", "'[@android:string/ok]'");
- checkWord("'@android^:string/ok'", "'[@android:string/ok]'");
- checkWord("'^@android:string/ok'", "'[@android:string/ok]'");
- checkWord("'@android:^string/ok'", "'[@android:string/ok]'");
- checkWord("'@android:string^/ok'", "'[@android:string/ok]'");
- checkWord("'@android:string/^ok'", "'@android:string/[ok]'");
- checkWord("'@android:string/o^k'", "'@android:string/[ok]'");
- checkWord("'@android:string/ok^'", "'@android:string/[ok]'");
- checkWord("'@string/ok^'", "'@string/[ok]'");
- checkWord("'@str^ing/ok'", "'[@string/ok]'");
- }
-
- public void test_getWord_classnames() throws Exception {
- checkWord("\"co^m.example.templatetest1\"", "\"[com.example.templatetest1]\"");
- checkWord("\"com.exam^ple.templatetest1\"", "\"[com.example.templatetest1]\"");
- checkWord("\"com.example^.templatetest1\"", "\"[com.example.templatetest1]\"");
- checkWord("\"com.example.templat^etest1\"", "\"com.example.[templatetest1]\"");
- checkWord("\"com.example.^templatetest1\"", "\"com.example.[templatetest1]\"");
- checkWord("\"com.example.templatetest1^\"", "\"com.example.[templatetest1]\"");
- checkWord("\"...^\"", "\"[...]\"");
- checkWord("\"..^.\"", "\"[...]\"");
- }
-
- private void checkWord(String before, String expected) throws Exception {
- AndroidDoubleClickStrategy strategy = new AndroidDoubleClickStrategy();
- int cursor = before.indexOf('^');
- assertTrue("Must set cursor position with ^ in " + before, cursor != -1);
- before = before.substring(0, cursor) + before.substring(cursor + 1);
- assertEquals(-1, before.indexOf('^'));
- assertEquals(-1, before.indexOf('['));
- assertEquals(-1, before.indexOf(']'));
-
- Point positions = strategy.getWord(before, cursor);
- assertNotNull(positions);
- assertTrue(positions.y >= positions.x);
- String after = before.substring(0, positions.x) + '[' +
- before.substring(positions.x, positions.y) + ']' +
- before.substring(positions.y);
- assertEquals(expected, after);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtilsTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtilsTest.java
deleted file mode 100644
index 03db18956..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtilsTest.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (C) 2008 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.editors.descriptors;
-
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-
-import junit.framework.TestCase;
-
-/**
- * Unit tests for DescriptorsUtils in the editors plugin
- */
-@SuppressWarnings("javadoc")
-public class DescriptorsUtilsTest extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testPrettyAttributeUiName() {
- assertEquals("", DescriptorsUtils.prettyAttributeUiName(""));
-
- assertEquals("Max width for view",
- DescriptorsUtils.prettyAttributeUiName("maxWidthForView"));
-
- assertEquals("Layout width",
- DescriptorsUtils.prettyAttributeUiName("layout_width"));
-
- // X Y and Z are capitalized when used as single words (so "T" becomes "t")
- assertEquals("Axis X", DescriptorsUtils.prettyAttributeUiName("axisX"));
- assertEquals("Axis Y", DescriptorsUtils.prettyAttributeUiName("axisY"));
- assertEquals("Axis Z", DescriptorsUtils.prettyAttributeUiName("axisZ"));
- assertEquals("Axis t", DescriptorsUtils.prettyAttributeUiName("axisT"));
-
- assertEquals("The X axis", DescriptorsUtils.prettyAttributeUiName("theXAxis"));
- assertEquals("The Y axis", DescriptorsUtils.prettyAttributeUiName("theYAxis"));
- assertEquals("The Z axis", DescriptorsUtils.prettyAttributeUiName("theZAxis"));
- assertEquals("The t axis", DescriptorsUtils.prettyAttributeUiName("theTAxis"));
-
- // Special cases for "uri" and "sdk" etc
- assertEquals("Grant URI permission",
- DescriptorsUtils.prettyAttributeUiName("grantUriPermission"));
- assertEquals("URI permission",
- DescriptorsUtils.prettyAttributeUiName("uriPermission"));
- assertEquals("Min SDK version", DescriptorsUtils.prettyAttributeUiName("minSdkVersion"));
- assertEquals("SDK version", DescriptorsUtils.prettyAttributeUiName("sdkVersion"));
- assertEquals("IME action method",
- DescriptorsUtils.prettyAttributeUiName("imeActionMethod"));
- assertEquals("VM safe mode", DescriptorsUtils.prettyAttributeUiName("vmSafeMode"));
- assertEquals("UI options", DescriptorsUtils.prettyAttributeUiName("uiOptions"));
- }
-
- public void testCapitalize() {
- assertEquals("", DescriptorsUtils.capitalize(""));
-
- assertEquals("Max Width For View",
- DescriptorsUtils.capitalize("maxWidthForView"));
-
- assertEquals("Layout Width",
- DescriptorsUtils.capitalize("layout_width"));
-
- assertEquals("Axis X", DescriptorsUtils.capitalize("axisX"));
- assertEquals("Axis Y", DescriptorsUtils.capitalize("axisY"));
- assertEquals("Axis Z", DescriptorsUtils.capitalize("axisZ"));
- assertEquals("Axis T", DescriptorsUtils.capitalize("axisT"));
-
- assertEquals("The X Axis", DescriptorsUtils.capitalize("theXAxis"));
- assertEquals("The Y Axis", DescriptorsUtils.capitalize("theYAxis"));
- assertEquals("The Z Axis", DescriptorsUtils.capitalize("theZAxis"));
- assertEquals("The T Axis", DescriptorsUtils.capitalize("theTAxis"));
-
- // Special cases for "uri" and "sdk" etc
- assertEquals("Grant URI Permission", DescriptorsUtils.capitalize("grantUriPermission"));
- assertEquals("Min SDK Version", DescriptorsUtils.capitalize("minSdkVersion"));
- assertEquals("IME Action Method", DescriptorsUtils.capitalize("imeActionMethod"));
- assertEquals("URI Permission", DescriptorsUtils.capitalize("uriPermission"));
- assertEquals("SDK Version", DescriptorsUtils.capitalize("sdkVersion"));
- assertEquals("Grant IME", DescriptorsUtils.capitalize("GrantIme"));
- assertEquals("VM Safe Mode", DescriptorsUtils.capitalize("vmSafeMode"));
- assertEquals("UI Options", DescriptorsUtils.capitalize("uiOptions"));
- }
-
- public void testFormatTooltip() {
- assertEquals("", DescriptorsUtils.formatTooltip(""));
-
- assertEquals("\"application\"",
- DescriptorsUtils.formatTooltip(
- "<code>application</code>"));
-
- assertEquals("android.content.Intent",
- DescriptorsUtils.formatTooltip(
- "{@link android.content.Intent}"));
-
- assertEquals("FLAG_ACTIVITY_SINGLE_TOP",
- DescriptorsUtils.formatTooltip(
- "{@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}"));
-
- assertEquals("activity-alias",
- DescriptorsUtils.formatTooltip(
- "{@link \t #AndroidManifestActivityAlias \tactivity-alias }"));
-
- assertEquals("\"permission\"",
- DescriptorsUtils.formatTooltip(
- "{@link #AndroidManifestPermission &lt;permission&gt;}"));
-
- assertEquals("and etc.",
- DescriptorsUtils.formatTooltip(
- "{@link #IntentCategory <category> and etc. }"));
-
- assertEquals("Activity.onNewIntent()",
- DescriptorsUtils.formatTooltip(
- "{@link android.app.Activity#onNewIntent Activity.onNewIntent()}"));
- }
-
- public void testFormatFormText() {
- ElementDescriptor desc = new ElementDescriptor("application");
- desc.setSdkUrl(DescriptorsUtils.MANIFEST_SDK_URL + "TagApplication");
- String docBaseUrl = "http://base";
- assertEquals("<form><li style=\"image\" value=\"image\"></li></form>", DescriptorsUtils.formatFormText("", desc, docBaseUrl));
-
- assertEquals("<form><li style=\"image\" value=\"image\"><a href=\"http://base/reference/android/R.styleable.html#TagApplication\">application</a></li></form>",
- DescriptorsUtils.formatFormText(
- "<code>application</code>",
- desc, docBaseUrl));
-
- assertEquals("<form><li style=\"image\" value=\"image\"><b>android.content.Intent</b></li></form>",
- DescriptorsUtils.formatFormText(
- "{@link android.content.Intent}",
- desc, docBaseUrl));
-
- assertEquals("<form><li style=\"image\" value=\"image\"><a href=\"http://base/reference/android/R.styleable.html#AndroidManifestPermission\">AndroidManifestPermission</a></li></form>",
- DescriptorsUtils.formatFormText(
- "{@link #AndroidManifestPermission}",
- desc, docBaseUrl));
-
- assertEquals("<form><li style=\"image\" value=\"image\"><a href=\"http://base/reference/android/R.styleable.html#AndroidManifestPermission\">\"permission\"</a></li></form>",
- DescriptorsUtils.formatFormText(
- "{@link #AndroidManifestPermission &lt;permission&gt;}",
- desc, docBaseUrl));
- }
-
- public void testGetFreeWidgetId() throws Exception {
- DocumentDescriptor documentDescriptor =
- new DocumentDescriptor("layout_doc", null); //$NON-NLS-1$
- UiDocumentNode model = new UiDocumentNode(documentDescriptor);
- UiElementNode uiRoot = model.getUiRoot();
-
- assertEquals("@+id/button1", DescriptorsUtils.getFreeWidgetId(uiRoot, "Button"));
- assertEquals("@+id/linearLayout1",
- DescriptorsUtils.getFreeWidgetId(uiRoot, "LinearLayout"));
- }
-
- public void testNeedsDefaultId() throws Exception {
- assertTrue(DescriptorsUtils.needsDefaultId(new ElementDescriptor("Button")));
- assertTrue(DescriptorsUtils.needsDefaultId(new ElementDescriptor("EditText")));
- assertTrue(DescriptorsUtils.needsDefaultId(new ElementDescriptor("TextView")));
-
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("LinearLayout")));
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("GridLayout")));
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("RelativeLayout")));
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("include")));
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("merge")));
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("fragment")));
- assertFalse(DescriptorsUtils.needsDefaultId(new ElementDescriptor("Space")));
- }
-
- private static ViewElementDescriptor createDesc(String name, String fqn, boolean hasChildren) {
- if (hasChildren) {
- return new ViewElementDescriptor(name, name, fqn, "", "", new AttributeDescriptor[0],
- new AttributeDescriptor[0], new ElementDescriptor[1], false);
- } else {
- return new ViewElementDescriptor(name, fqn);
- }
- }
-
- public void testCanInsertChildren() throws Exception {
- assertFalse(DescriptorsUtils.canInsertChildren(createDesc("android:Button",
- "android.widget.Button", false), null));
- assertTrue(DescriptorsUtils.canInsertChildren(createDesc("android:LinearLayout",
- "android.view.LinearLayout", true), null));
- assertFalse(DescriptorsUtils.canInsertChildren(createDesc("android:ListView",
- "android.widget.ListView", true), null));
- assertFalse(DescriptorsUtils.canInsertChildren(createDesc("android:ExpandableListView",
- "android.widget.ExpandableListView", true), null));
- assertFalse(DescriptorsUtils.canInsertChildren(createDesc("android:Gallery",
- "android.widget.Gallery", true), null));
- assertFalse(DescriptorsUtils.canInsertChildren(createDesc("android:GridView",
- "android.widget.GridView", true), null));
-
- // This isn't the Android one (missing android: namespace prefix):
- // This test is disabled since I had to remove the namespace enforcement
- // (see namespace-related comment in canInsertChildren)
- //assertTrue(DescriptorsUtils.canInsertChildren(createDesc("mynamespace:ListView",
- // "android.widget.ListView", true), null));
-
- // Custom view without known view object
- assertTrue(DescriptorsUtils.canInsertChildren(createDesc("MyView",
- "foo.bar.MyView", true), null));
-
- // Custom view with known view object that extends AdapterView
- Object view = new MyClassLoader().findClass("foo.bar.MyView").newInstance();
- assertFalse(DescriptorsUtils.canInsertChildren(createDesc("MyView",
- "foo.bar.MyView", true), view));
- }
-
- /** Test class loader which finds foo.bar.MyView extends android.widget.AdapterView */
- private static class MyClassLoader extends ClassLoader {
- public MyClassLoader() {
- super(null);
- }
-
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- if (name.equals("foo.bar.MyView")) {
- // Simple class stub compiled by javac and dumped as bytes:
- //package foo.bar;
- //public class MyView extends android.widget.AdapterView {
- // public MyView() {
- // super(null);
- // }
- //}
- byte[] classData = new byte[] {
- -54,-2,-70,-66,0,0,0,49,0,17,10,0,3,0,13,7,0,14,7,0,15,1,0,6,60,105,110,
- 105,116,62,1,0,3,40,41,86,1,0,4,67,111,100,101,1,0,15,76,105,110,101,78,
- 117,109,98,101,114,84,97,98,108,101,1,0,18,76,111,99,97,108,86,97,114,
- 105,97,98,108,101,84,97,98,108,101,1,0,4,116,104,105,115,1,0,16,76,102,
- 111,111,47,98,97,114,47,77,121,86,105,101,119,59,1,0,10,83,111,117,114,
- 99,101,70,105,108,101,1,0,11,77,121,86,105,101,119,46,106,97,118,97,12,
- 0,4,0,16,1,0,14,102,111,111,47,98,97,114,47,77,121,86,105,101,119,1,0,
- 26,97,110,100,114,111,105,100,47,119,105,100,103,101,116,47,65,100,97,
- 112,116,101,114,86,105,101,119,1,0,28,40,76,97,110,100,114,111,105,100,
- 47,99,111,110,116,101,110,116,47,67,111,110,116,101,120,116,59,41,86,0,
- 33,0,2,0,3,0,0,0,0,0,1,0,1,0,4,0,5,0,1,0,6,0,0,0,52,0,2,0,1,0,0,0,6,42,
- 1,-73,0,1,-79,0,0,0,2,0,7,0,0,0,10,0,2,0,0,0,9,0,5,0,10,0,8,0,0,0,12,0,
- 1,0,0,0,6,0,9,0,10,0,0,0,1,0,11,0,0,0,2,0,12
- };
- return defineClass("foo.bar.MyView", classData, 0, classData.length);
- }
- if (name.equals("android.widget.AdapterView")) {
- // Simple class stub compiled by javac and dumped as bytes:
- //package android.widget;
- //public class AdapterView {
- // public AdapterView(android.content.Context context) { }
- //}
- byte[] classData = new byte[] {
- -54,-2,-70,-66,0,0,0,49,0,19,10,0,3,0,15,7,0,16,7,0,17,1,0,6,60,105,110,
- 105,116,62,1,0,28,40,76,97,110,100,114,111,105,100,47,99,111,110,116,101,
- 110,116,47,67,111,110,116,101,120,116,59,41,86,1,0,4,67,111,100,101,1,0,
- 15,76,105,110,101,78,117,109,98,101,114,84,97,98,108,101,1,0,18,76,111,
- 99,97,108,86,97,114,105,97,98,108,101,84,97,98,108,101,1,0,4,116,104,105,
- 115,1,0,28,76,97,110,100,114,111,105,100,47,119,105,100,103,101,116,47,
- 65,100,97,112,116,101,114,86,105,101,119,59,1,0,7,99,111,110,116,101,120,
- 116,1,0,25,76,97,110,100,114,111,105,100,47,99,111,110,116,101,110,116,
- 47,67,111,110,116,101,120,116,59,1,0,10,83,111,117,114,99,101,70,105,108,
- 101,1,0,16,65,100,97,112,116,101,114,86,105,101,119,46,106,97,118,97,12,
- 0,4,0,18,1,0,26,97,110,100,114,111,105,100,47,119,105,100,103,101,116,
- 47,65,100,97,112,116,101,114,86,105,101,119,1,0,16,106,97,118,97,47,108,
- 97,110,103,47,79,98,106,101,99,116,1,0,3,40,41,86,0,33,0,2,0,3,0,0,0,0,0,
- 1,0,1,0,4,0,5,0,1,0,6,0,0,0,57,0,1,0,2,0,0,0,5,42,-73,0,1,-79,0,0,0,2,0,
- 7,0,0,0,6,0,1,0,0,0,8,0,8,0,0,0,22,0,2,0,0,0,5,0,9,0,10,0,0,0,0,0,5,0,11,
- 0,12,0,1,0,1,0,13,0,0,0,2,0,14
- };
- return defineClass("android.widget.AdapterView", classData, 0, classData.length);
- }
-
- return super.findClass(name);
- }
- }
-
- public void testGetBasename() {
- assertEquals("Foo", DescriptorsUtils.getBasename("Foo"));
- assertEquals("Foo", DescriptorsUtils.getBasename("foo.Foo"));
- assertEquals("String", DescriptorsUtils.getBasename("java.util.String"));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/GraphicsUtilitiesTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/GraphicsUtilitiesTest.java
deleted file mode 100644
index 4f00097bc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/GraphicsUtilitiesTest.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.ide.eclipse.adt.internal.editors.draw9patch.graphics;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.widgets.Display;
-
-public class GraphicsUtilitiesTest extends TestCase {
- private static final int MASK_ALPHA = 0xFF000000;
-
- private static final String DIR = "/com/android/ide/eclipse/testdata/draw9patch/";
-
- public void testConvertToNinePatchNull() throws Exception {
- ImageData result = GraphicsUtilities.convertToNinePatch(null);
- assertNull(result);
- }
-
- public void testConvertToNinePatch() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
- ImageData baseData = image.getImageData();
-
- ImageData result = GraphicsUtilities.convertToNinePatch(baseData);
-
- assertEquals(baseData.width + 2, result.width);
- assertEquals(baseData.height + 2, result.height);
-
- // horizontal
- for (int x = 0; x < result.width; x++) {
-
- // top row
- assertEquals(0x0, result.getPixel(x, 0) & MASK_ALPHA);
-
- // bottom row
- assertEquals(0x0, result.getPixel(x, result.height - 1) & MASK_ALPHA);
- }
-
- // vertical
- for (int y = 0; y < result.height; y++) {
-
- // left column
- assertEquals(0x0, result.getPixel(0, y) & MASK_ALPHA);
-
- // right column
- assertEquals(0x0, result.getPixel(result.width - 1, y) & MASK_ALPHA);
- }
- }
-
- public void testClearImageDataNull() throws Exception {
- try {
- GraphicsUtilities.clearImageData(null);
- fail();
- } catch (IllegalArgumentException e) {
- }
- }
-
- public void testClearImageData() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
-
- ImageData baseData = image.getImageData();
- GraphicsUtilities.clearImageData(baseData);
- for (int y = 0; y < baseData.height; y++) {
- for (int x = 0; x < baseData.width; x++) {
- assertEquals(0x000000, baseData.getPixel(x, y));
- assertEquals(0x00, baseData.getAlpha(x, y));
- }
- }
-
- }
-
- public void testCopyNull() throws Exception {
- ImageData result = GraphicsUtilities.copy(null);
- assertNull(result);
- }
-
- public void testCopy() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
-
- ImageData baseData = image.getImageData();
- ImageData copiedData = GraphicsUtilities.copy(baseData);
-
- assertEquals(baseData.width, copiedData.width);
- assertEquals(baseData.height, copiedData.height);
- assertEquals(baseData.depth, copiedData.depth);
- assertEquals(baseData.transparentPixel, copiedData.transparentPixel);
- assertEquals(baseData.alpha, copiedData.alpha);
- assertTrue(baseData.palette.equals(copiedData.palette));
-
- final int[] baseColors = new int[baseData.width];
- final byte[] baseAlpha = new byte[baseData.width];
-
- final int[] copiedColors = new int[copiedData.width];
- final byte[] copiedAlpha = new byte[copiedData.width];
-
- for (int y = 0; y < baseData.height; y++) {
-
- baseData.getPixels(0, y, baseData.width, baseColors, 0);
- baseData.getPixels(0, y, baseData.width, copiedColors, 0);
- assertTrue(Arrays.equals(baseColors, copiedColors));
-
- baseData.getAlphas(0, y, baseData.width, baseAlpha, 0);
- baseData.getAlphas(0, y, baseData.width, copiedAlpha, 0);
- assertTrue(Arrays.equals(baseAlpha, copiedAlpha));
-
- }
- }
-
- public void testGetVerticalPixelsIllegalArgument() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
-
- ImageData baseData = image.getImageData();
- int[] temp = new int[baseData.width];
-
- // data must not be null
- try {
- GraphicsUtilities.getVerticalPixels(null, 0, 0, 1, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // out must not be null
- try {
- GraphicsUtilities.getVerticalPixels(baseData, 0, 0, 1, null);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // out length must be > height
- try {
- GraphicsUtilities.getVerticalPixels(baseData, 0, 0, 1, new int[0]);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // x must be > 0
- try {
- GraphicsUtilities.getVerticalPixels(baseData, -1, 0, 1, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // y must be > 0
- try {
- GraphicsUtilities.getVerticalPixels(baseData, 0, -1, 1, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // height must be >= 0
- try {
- GraphicsUtilities.getVerticalPixels(baseData, 0, 0, 0, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // argument x must be < data.width
- try {
- GraphicsUtilities.getVerticalPixels(baseData, baseData.width, 0, baseData.height, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // argument y must be < data.height
- try {
- GraphicsUtilities
- .getVerticalPixels(baseData, 0, baseData.height, baseData.height, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // argument height must be > (y + data.height)
- try {
- GraphicsUtilities.getVerticalPixels(baseData, 0, 1, baseData.height, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- }
-
- public void testGetVerticalPixels() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
-
- ImageData baseData = image.getImageData();
- int[] temp = new int[baseData.width];
-
- GraphicsUtilities.getVerticalPixels(baseData, 0, 0, baseData.height, temp);
-
- int height = baseData.height;
- for (int y = 0; y < height; y++) {
- assertEquals(baseData.getPixel(0, y), temp[y]);
- }
- }
-
- public void testGetHorizontalPixelsIllegalArgument() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
-
- ImageData baseData = image.getImageData();
- int[] temp = new int[baseData.width];
-
- // data must not be null
- try {
- GraphicsUtilities.getHorizontalPixels(null, 0, 0, 1, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // out must not be null
- try {
- GraphicsUtilities.getHorizontalPixels(baseData, 0, 0, 1, null);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // out length must be > width
- try {
- GraphicsUtilities.getHorizontalPixels(baseData, 0, 0, 1, new int[0]);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // x must be > 0
- try {
- GraphicsUtilities.getHorizontalPixels(baseData, -1, 0, 1, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // y must be > 0
- try {
- GraphicsUtilities.getHorizontalPixels(baseData, 0, -1, 1, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // width must be >= 0
- try {
- GraphicsUtilities.getHorizontalPixels(baseData, 0, 0, 0, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // argument x must be < data.width
- try {
- GraphicsUtilities
- .getHorizontalPixels(baseData, baseData.width, 0, baseData.width, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // argument y must be < data.height
- try {
- GraphicsUtilities
- .getHorizontalPixels(baseData, 0, baseData.height, baseData.width, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- // argument width must be > (x + data.width)
- try {
- GraphicsUtilities.getHorizontalPixels(baseData, 1, 0, baseData.width, temp);
- fail();
- } catch (IllegalArgumentException e) {
- }
-
- }
-
- public void testGetHorizontalPixels() throws Exception {
- String fileName = DIR + "no-patched.png";
- Image image = new Image(Display.getDefault(),
- getClass().getResourceAsStream(fileName));
-
- ImageData baseData = image.getImageData();
- int[] temp = new int[baseData.width];
-
- GraphicsUtilities.getHorizontalPixels(baseData, 0, 0, baseData.width, temp);
-
- int width = baseData.width;
- for (int x = 0; x < width; x++) {
- assertEquals(baseData.getPixel(x, 0), temp[x]);
- }
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/NinePatchedImageTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/NinePatchedImageTest.java
deleted file mode 100644
index 72c929618..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/draw9patch/graphics/NinePatchedImageTest.java
+++ /dev/null
@@ -1,914 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.ide.eclipse.adt.internal.editors.draw9patch.graphics;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-
-import com.android.ide.eclipse.adt.internal.editors.draw9patch.graphics.NinePatchedImage.Chunk;
-import com.android.ide.eclipse.adt.internal.editors.draw9patch.graphics.NinePatchedImage.Projection;
-import com.android.ide.eclipse.adt.internal.editors.draw9patch.graphics.NinePatchedImage.Tick;
-
-public class NinePatchedImageTest extends TestCase {
-
- private static final String DIR = "/com/android/ide/eclipse/testdata/draw9patch/";
-
- public void testReadNoPatchedImage() throws Exception {
- String fileName = DIR + "no-patched.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- ImageData data = image.getImageData();
- int width = data.width;
- int height = data.height;
-
- assertEquals(72, width);
- assertEquals(50, height);
-
- assertFalse(image.hasNinePatchExtension());
- }
-
- public void testReadNoPatchedInteraceImage() throws Exception {
- String fileName = DIR + "no-patched-interlace.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- ImageData data = image.getImageData();
- int width = data.width;
- int height = data.height;
-
- assertEquals(72, width);
- assertEquals(50, height);
-
- assertFalse(image.hasNinePatchExtension());
- }
-
- public void testConvert9PatchedImage() throws Exception {
- String fileName = DIR + "no-patched.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- ImageData data = image.getImageData();
- int width = data.width;
- int height = data.height;
-
- assertEquals(72, width);
- assertEquals(50, height);
-
- assertFalse(image.hasNinePatchExtension());
-
- image.convertToNinePatch();
-
- data = image.getImageData();
- width = data.width;
- height = data.height;
-
- // increased patch size
- assertEquals(72 + 2, width);
- assertEquals(50 + 2, height);
-
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.isDirty());
-
- // initialized patches
- List<Tick> horizontalPatches = image.getHorizontalPatches();
- List<Tick> verticalPatches = image.getVerticalPatches();
- assertEquals(1, horizontalPatches.size());
- assertEquals(1, verticalPatches.size());
-
- // initialized contents area
- List<Tick> horizontalContentsArea = image.getHorizontalContents();
- List<Tick> verticalContentsArea = image.getVerticalContents();
- assertEquals(1, horizontalContentsArea.size());
- assertEquals(1, verticalContentsArea.size());
-
- // content area rectangle
- Rectangle contentsArea = image.getContentArea();
- assertEquals(new Rectangle(1, 1, width - 2, height - 2), contentsArea);
- }
-
- public void testReadInvalidPatchedImageCorners() throws Exception {
-
- // top-left
- String fileName = DIR + "invalid-patched1.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // top-right
- fileName = DIR + "invalid-patched2.9.png";
- image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // bottom-left
- fileName = DIR + "invalid-patched3.9.png";
- image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // bottom-right
- fileName = DIR + "invalid-patched4.9.png";
- image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
- }
-
- public void testReadInvalidPatchedImageLine() throws Exception {
-
- // top
- String fileName = DIR + "invalid-patched5.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // right
- fileName = DIR + "invalid-patched6.9.png";
- image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // bottom
- fileName = DIR + "invalid-patched7.9.png";
- image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // left
- fileName = DIR + "invalid-patched8.9.png";
- image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
- }
-
- public void testEnsure9PatchIgnoreInvalidPixels() throws Exception {
- // top
- String fileName = DIR + "invalid-patched5.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- // invalid pixel
- int invalidPixel = image.getImageData().getPixel(33, 0);
- assertTrue(0x0 != invalidPixel);
-
- assertTrue(image.hasNinePatchExtension());
- assertFalse(image.ensure9Patch());
-
- // ensure9path() ignored invalid pixels
- int invalidPixelAlpha = image.getImageData().getAlpha(33, 0);
- assertEquals(0x00, invalidPixelAlpha);
- }
-
- public void test9Patch1() throws Exception {
- String fileName = DIR + "patched1.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- // patches
- List<Tick> horizontalPatches = image.getHorizontalPatches();
- List<Tick> verticalPatches = image.getVerticalPatches();
- assertEquals(3, horizontalPatches.size());
- assertEquals(3, verticalPatches.size());
-
- Chunk[][] chunks = null;
- chunks = image.getChunks(chunks);
-
- // vertical chunk size
- assertEquals(3, chunks.length);
-
- // horizontal chunk size
- for (int i = 0; i < chunks.length; i++) {
- assertEquals(3, chunks[i].length);
- }
-
- Chunk c = null;
- Rectangle rect = null;
-
- // Row 1
- c = chunks[0][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(1, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[0][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(2, rect.x);
- assertEquals(1, rect.y);
- assertEquals(70, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[0][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(1, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- // Row 2
- c = chunks[1][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(2, rect.y);
- assertEquals(1, rect.width);
- assertEquals(48, rect.height);
-
- c = chunks[1][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(2, rect.x);
- assertEquals(2, rect.y);
- assertEquals(70, rect.width);
- assertEquals(48, rect.height);
-
- c = chunks[1][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(2, rect.y);
- assertEquals(1, rect.width);
- assertEquals(48, rect.height);
-
- // Row 3
- c = chunks[2][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(50, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[2][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(2, rect.x);
- assertEquals(50, rect.y);
- assertEquals(70, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[2][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(50, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
- }
-
- public void test9Patch2() throws Exception {
- String fileName = DIR + "patched2.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- // patches
- List<Tick> horizontalPatches = image.getHorizontalPatches();
- List<Tick> verticalPatches = image.getVerticalPatches();
- assertEquals(5, horizontalPatches.size());
- assertEquals(7, verticalPatches.size());
-
- NinePatchedImage.Chunk[][] chunks = null;
- chunks = image.getChunks(chunks);
-
- // vertical chunk size
- assertEquals(7, chunks.length);
-
- // horizontal chunk size
- for (int i = 0; i < chunks.length; i++) {
- assertEquals(5, chunks[i].length);
- }
-
- NinePatchedImage.Chunk c = null;
- Rectangle rect = null;
-
- // Row 1
- c = chunks[0][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(1, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[0][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(2, rect.x);
- assertEquals(1, rect.y);
- assertEquals(34, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[0][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(1, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[0][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(37, rect.x);
- assertEquals(1, rect.y);
- assertEquals(35, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[0][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(1, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- // Row 2
- c = chunks[1][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(2, rect.y);
- assertEquals(1, rect.width);
- assertEquals(7, rect.height);
-
- c = chunks[1][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(2, rect.x);
- assertEquals(2, rect.y);
- assertEquals(34, rect.width);
- assertEquals(7, rect.height);
-
- c = chunks[1][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(2, rect.y);
- assertEquals(1, rect.width);
- assertEquals(7, rect.height);
-
- c = chunks[1][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(37, rect.x);
- assertEquals(2, rect.y);
- assertEquals(35, rect.width);
- assertEquals(7, rect.height);
-
- c = chunks[1][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(2, rect.y);
- assertEquals(1, rect.width);
- assertEquals(7, rect.height);
-
- // Row 3
- c = chunks[2][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(9, rect.y);
- assertEquals(1, rect.width);
- assertEquals(4, rect.height);
-
- c = chunks[2][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(2, rect.x);
- assertEquals(9, rect.y);
- assertEquals(34, rect.width);
- assertEquals(4, rect.height);
-
- c = chunks[2][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(9, rect.y);
- assertEquals(1, rect.width);
- assertEquals(4, rect.height);
-
- c = chunks[2][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(37, rect.x);
- assertEquals(9, rect.y);
- assertEquals(35, rect.width);
- assertEquals(4, rect.height);
-
- c = chunks[2][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(9, rect.y);
- assertEquals(1, rect.width);
- assertEquals(4, rect.height);
-
- // Row 4
- c = chunks[3][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(13, rect.y);
- assertEquals(1, rect.width);
- assertEquals(13, rect.height);
-
- c = chunks[3][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(2, rect.x);
- assertEquals(13, rect.y);
- assertEquals(34, rect.width);
- assertEquals(13, rect.height);
-
- c = chunks[3][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(13, rect.y);
- assertEquals(1, rect.width);
- assertEquals(13, rect.height);
-
- c = chunks[3][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(37, rect.x);
- assertEquals(13, rect.y);
- assertEquals(35, rect.width);
- assertEquals(13, rect.height);
-
- c = chunks[3][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(13, rect.y);
- assertEquals(1, rect.width);
- assertEquals(13, rect.height);
-
- // Row 5
- c = chunks[4][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(26, rect.y);
- assertEquals(1, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[4][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(2, rect.x);
- assertEquals(26, rect.y);
- assertEquals(34, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[4][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(26, rect.y);
- assertEquals(1, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[4][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(37, rect.x);
- assertEquals(26, rect.y);
- assertEquals(35, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[4][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(26, rect.y);
- assertEquals(1, rect.width);
- assertEquals(12, rect.height);
-
- // Row 6
- c = chunks[5][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(38, rect.y);
- assertEquals(1, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[5][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(2, rect.x);
- assertEquals(38, rect.y);
- assertEquals(34, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[5][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(38, rect.y);
- assertEquals(1, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[5][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_FIXED, c.type);
- assertEquals(37, rect.x);
- assertEquals(38, rect.y);
- assertEquals(35, rect.width);
- assertEquals(12, rect.height);
-
- c = chunks[5][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(38, rect.y);
- assertEquals(1, rect.width);
- assertEquals(12, rect.height);
-
- // Row 7
- c = chunks[6][0];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(1, rect.x);
- assertEquals(50, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[6][1];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(2, rect.x);
- assertEquals(50, rect.y);
- assertEquals(34, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[6][2];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(36, rect.x);
- assertEquals(50, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[6][3];
- rect = c.rect;
- assertEquals(Chunk.TYPE_VERTICAL, c.type);
- assertEquals(37, rect.x);
- assertEquals(50, rect.y);
- assertEquals(35, rect.width);
- assertEquals(1, rect.height);
-
- c = chunks[6][4];
- rect = c.rect;
- assertEquals(Chunk.TYPE_HORIZONTAL | Chunk.TYPE_VERTICAL, c.type);
- assertEquals(72, rect.x);
- assertEquals(50, rect.y);
- assertEquals(1, rect.width);
- assertEquals(1, rect.height);
- }
-
- public void testContentArea() throws Exception {
- String fileName = DIR + "content-area.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- // contents area
- List<Tick> horizontalContentsArea = image.getHorizontalContents();
- List<Tick> verticalContentsArea = image.getVerticalContents();
- assertEquals(3, horizontalContentsArea.size());
- assertEquals(3, verticalContentsArea.size());
-
- // content area rectangle
- Rectangle contentsArea = image.getContentArea();
- assertEquals(new Rectangle(19, 13, 35, 25), contentsArea);
- }
-
- public void testContentAreaOneDot() throws Exception {
- String fileName = DIR + "content-area-one-dot.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- // contents area
- List<Tick> horizontalContentsArea = image.getHorizontalContents();
- List<Tick> verticalContentsArea = image.getVerticalContents();
- assertEquals(3, horizontalContentsArea.size());
- assertEquals(3, verticalContentsArea.size());
-
- // content area rectangle
- Rectangle contentsArea = image.getContentArea();
- assertEquals(new Rectangle(19, 13, 1, 1), contentsArea);
- }
-
- public void testContentAreaTwoDots() throws Exception {
- String fileName = DIR + "content-area-two-dots.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- // contents area
- List<Tick> horizontalContentsArea = image.getHorizontalContents();
- List<Tick> verticalContentsArea = image.getVerticalContents();
- assertEquals(5, horizontalContentsArea.size());
- assertEquals(5, verticalContentsArea.size());
-
- // content area rectangle
- Rectangle contentsArea = image.getContentArea();
- assertEquals(new Rectangle(19, 13, 35, 25), contentsArea);
-
- String fileName2 = DIR + "content-area.9.png";
- NinePatchedImage image2 = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName2), fileName2);
- assertNotNull(image2);
-
- assertTrue(image2.hasNinePatchExtension());
- assertTrue(image2.ensure9Patch());
-
- // content area rectangle
- Rectangle contentsArea2 = image2.getContentArea();
- assertEquals(contentsArea2, contentsArea);
- }
-
- public void testBadPatches() throws Exception {
- String fileName = DIR + "patched-with-badpatches.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- Chunk[][] chunks = null;
- chunks = image.getChunks(chunks);
-
- // vertical chunk size
- assertEquals(5, chunks.length);
-
- // horizontal chunk size
- for (int i = 0; i < chunks.length; i++) {
- assertEquals(7, chunks[i].length);
- }
-
- chunks = image.getCorruptedChunks(chunks);
-
- Chunk c = null;
-
- // collect bad patches
- List<Point> badPatches = new ArrayList<Point>(5 * 7);
- for (int y = 0; y < chunks.length; y++) {
- for (int x = 0; x < chunks[0].length; x++) {
- c = chunks[y][x];
- if ((c.type & Chunk.TYPE_CORRUPT) != 0x0) {
- badPatches.add(new Point(y, x));
- }
- }
- }
-
- assertEquals(15, badPatches.size());
-
- assertTrue(badPatches.contains(new Point(0, 3)));
-
- assertTrue(badPatches.contains(new Point(1, 1)));
- assertTrue(badPatches.contains(new Point(1, 2)));
- assertTrue(badPatches.contains(new Point(1, 3)));
- assertTrue(badPatches.contains(new Point(1, 4)));
- assertTrue(badPatches.contains(new Point(1, 5)));
-
- assertTrue(badPatches.contains(new Point(2, 1)));
- assertTrue(badPatches.contains(new Point(2, 5)));
-
- assertTrue(badPatches.contains(new Point(3, 0)));
- assertTrue(badPatches.contains(new Point(3, 1)));
- assertTrue(badPatches.contains(new Point(3, 5)));
- assertTrue(badPatches.contains(new Point(3, 6)));
-
- assertTrue(badPatches.contains(new Point(4, 1)));
- assertTrue(badPatches.contains(new Point(4, 3)));
- assertTrue(badPatches.contains(new Point(4, 5)));
- }
-
- public void testProjection() throws Exception {
- // top
- String fileName = DIR + "patched3.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
-
- ImageData data = image.getImageData();
- assertEquals(72 + 2, data.width);
- assertEquals(50 + 2, data.height);
-
- int width = 72 * 2;
- int height = 50 * 2;
-
- Chunk[][] chunks = null;
- chunks = image.getChunks(chunks);
-
- Projection[][] projections = null;
- projections = image.getProjections(width, height, projections);
-
- assertEquals(chunks.length, projections.length);
- for (int i = 0; i < chunks.length; i++) {
- assertEquals(chunks[i].length, projections[i].length);
- }
-
- for (int y = 0; y < projections.length; y++) {
- for (int x = 0; x < projections[y].length; x++) {
- assertEquals(projections[y][x].src, chunks[y][x].rect);
-
- // If chunk type is FIXED. Same projection size as original
- // chunk.
- if (projections[y][x].chunk.type == Chunk.TYPE_FIXED) {
- assertEquals(projections[y][x].dest.width, chunks[y][x].rect.width);
- assertEquals(projections[y][x].dest.height, chunks[y][x].rect.height);
- }
- }
- }
-
- Projection p = null;
- Rectangle rect = null;
-
- // Check start position
- p = projections[0][0];
-
- // src position start from 1, 9-patch row and column included.
- assertEquals(1, p.src.x);
- assertEquals(1, p.src.y);
-
- // dest position start from 0, 9-patch row and column ignored.
- assertEquals(0, p.dest.x);
- assertEquals(0, p.dest.y);
-
- // row 1
- p = projections[0][0];
- rect = p.dest;
- assertEquals(0, rect.x);
- assertEquals(0, rect.y);
- assertEquals(74, rect.width);
- assertEquals(5, rect.height);
-
- p = projections[0][1];
- rect = p.dest;
- assertEquals(74, rect.x);
- assertEquals(0, rect.y);
- assertEquals(62, rect.width);
- assertEquals(5, rect.height);
-
- p = projections[0][2];
- rect = p.dest;
- assertEquals(136, rect.x);
- assertEquals(0, rect.y);
- assertEquals(8, rect.width);
- assertEquals(5, rect.height);
-
- // row 2
- p = projections[1][0];
- rect = p.dest;
- assertEquals(0, rect.x);
- assertEquals(5, rect.y);
- assertEquals(74, rect.width);
- assertEquals(24, rect.height);
-
- p = projections[1][1];
- rect = p.dest;
- assertEquals(74, rect.x);
- assertEquals(5, rect.y);
- assertEquals(62, rect.width);
- assertEquals(24, rect.height);
-
- p = projections[1][2];
- rect = p.dest;
- assertEquals(136, rect.x);
- assertEquals(5, rect.y);
- assertEquals(8, rect.width);
- assertEquals(24, rect.height);
-
- // row 3
- p = projections[2][0];
- rect = p.dest;
- assertEquals(0, rect.x);
- assertEquals(29, rect.y);
- assertEquals(74, rect.width);
- assertEquals(58, rect.height);
-
- p = projections[2][1];
- rect = p.dest;
- assertEquals(74, rect.x);
- assertEquals(29, rect.y);
- assertEquals(62, rect.width);
- assertEquals(58, rect.height);
-
- p = projections[2][2];
- rect = p.dest;
- assertEquals(136, rect.x);
- assertEquals(29, rect.y);
- assertEquals(8, rect.width);
- assertEquals(58, rect.height);
-
- // row 4
- p = projections[3][0];
- rect = p.dest;
- assertEquals(0, rect.x);
- assertEquals(87, rect.y);
- assertEquals(74, rect.width);
- assertEquals(13, rect.height);
-
- p = projections[3][1];
- rect = p.dest;
- assertEquals(74, rect.x);
- assertEquals(87, rect.y);
- assertEquals(62, rect.width);
- assertEquals(13, rect.height);
-
- p = projections[3][2];
- rect = p.dest;
- assertEquals(136, rect.x);
- assertEquals(87, rect.y);
- assertEquals(8, rect.width);
- assertEquals(13, rect.height);
- }
-
- public void testReadLayoutBoundsOnlyImage() throws Exception {
- String fileName = DIR + "layout-bounds-only.9.png";
- NinePatchedImage image = new NinePatchedImage(getClass()
- .getResourceAsStream(fileName), fileName);
- assertNotNull(image);
-
- ImageData data = image.getImageData();
- int width = data.width;
- int height = data.height;
-
- assertEquals(74, width);
- assertEquals(52, height);
-
- assertTrue(image.hasNinePatchExtension());
- assertTrue(image.ensure9Patch());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java
deleted file mode 100644
index 9c7e25d4b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * 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.editors.formatting;
-
-import com.android.ide.common.xml.XmlFormatPreferences;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.ReplaceEdit;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class AndroidXmlFormattingStrategyTest extends TestCase {
- // In the given before document, replace in the range replaceStart to replaceEnd
- // the formatted string, and assert that it's identical to the given after string
- private void check(String before, int replaceStart, int replaceEnd, String formatted,
- String expected, XmlFormatPreferences prefs)
- throws MalformedTreeException, BadLocationException {
- Document document = new Document();
- document.set(before);
- ReplaceEdit edit = AndroidXmlFormattingStrategy.createReplaceEdit(document, replaceStart,
- replaceEnd, formatted, prefs);
- assertNotNull(edit);
- edit.apply(document);
- String contents = document.get();
- // Ensure that we don't have any mangled CRLFs
- char prev = 0;
- boolean haveCrlf = false;
- for (int i = 0, n = contents.length(); i < n; i++) {
- char c = contents.charAt(i);
- if (c == '\r') {
- haveCrlf = true;
- }
- if (!(c != '\r' || prev != '\r')) {
- fail("Mangled document: Found adjacent \\r's starting at " + i
- + ": " + contents.substring(i - 1, Math.min(contents.length(), i + 10))
- + "...");
- }
- if (haveCrlf && c == '\n' && prev != '\r') {
- fail("Mangled document: In a CRLF document, found \\n without preceeding \\r");
- }
-
- prev = c;
- }
-
- assertEquals(expected, contents);
- }
-
- // In the given before document, replace the range indicated by [ and ] with the given
- // formatted string, and assert that it's identical to the given after string
- private void check(
- String before, String insert, String expected,
- XmlFormatPreferences prefs)
- throws MalformedTreeException, BadLocationException {
- int replaceStart = before.indexOf('[');
- assertTrue(replaceStart != -1);
- before = before.substring(0, replaceStart) + before.substring(replaceStart + 1);
-
- int replaceEnd = before.indexOf(']');
- assertTrue(replaceEnd != -1);
- before = before.substring(0, replaceEnd) + before.substring(replaceEnd + 1);
-
- check(before, replaceStart, replaceEnd, insert, expected, prefs);
- }
-
- public void test1() throws Exception {
- check(
- // Before
- "<root>\n" +
- "[ <element/>\n" +
- " <second/>\n" +
- "]\n" +
- "</root>\n",
-
- // Insert
- " <element/>\n" +
- " <second/>\n",
-
- // After
- "<root>\n" +
- " <element/>\n" +
- " <second/>\n" +
- "\n" +
- "</root>\n",
-
- XmlFormatPreferences.defaults());
- }
-
- public void test2() throws Exception {
- XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
- prefs.removeEmptyLines = true;
-
- check(
- // Before
- "<root>\n" +
- "\n" +
- "\n" +
- "[ <element/>\n" +
- " <second/>\n" +
- "]\n" +
- "\n" +
- "\n" +
- "</root>\n",
-
- // Insert
- " <element/>\n" +
- " <second/>\n",
-
- // After
- "<root>\n" +
- " <element/>\n" +
- " <second/>\n" +
- "</root>\n",
-
- prefs);
- }
-
- public void test3() throws Exception {
- XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
- prefs.removeEmptyLines = true;
-
- check(
- // Before
- "<root>\n" +
- "\n" +
- "\n" +
- " [<element/>\n" +
- " <second/>]\n" +
- "\n" +
- "\n" +
- "\n" +
- "</root>\n",
-
- // Insert
- " <element/>\n" +
- " <second/>",
-
- // After
- "<root>\n" +
- " <element/>\n" +
- " <second/>\n" +
- "</root>\n",
-
- prefs);
- }
-
- public void test4() throws Exception {
- check(
- "<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" +
- "\n" +
- " [<TextView\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_centerHorizontal=\"true\"\n" +
- " android:layout_centerVertical=\"true\"\n" +
- " android:text=\"foo\"\n" +
- " tools:context=\".MainActivity\" />]\n" +
- "\n" +
- "</RelativeLayout>\n",
-
- // Insert
- "\n" +
- " <TextView\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_centerHorizontal=\"true\"\n" +
- " android:layout_centerVertical=\"true\"\n" +
- " android:text=\"foo\"\n" +
- " tools:context=\".MainActivity\" />\n",
-
- // After
- "<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" +
- "\n" +
- " <TextView\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_centerHorizontal=\"true\"\n" +
- " android:layout_centerVertical=\"true\"\n" +
- " android:text=\"foo\"\n" +
- " tools:context=\".MainActivity\" />\n" +
- "\n" +
- "</RelativeLayout>\n",
-
- XmlFormatPreferences.defaults());
- }
-
- public void testCrLf1() throws Exception {
- check(
- // Before
- "<root>\r\n" +
- "[ <element/>\r\n" +
- " <second/>\r\n" +
- "]\r\n" +
- "</root>\r\n",
-
- // Insert
- " <element/>\r\n" +
- " <second/>\r\n",
-
- // After
- "<root>\r\n" +
- " <element/>\r\n" +
- " <second/>\r\n" +
- "\r\n" +
- "</root>\r\n",
-
- XmlFormatPreferences.defaults());
- }
-
- public void testCrLf2() throws Exception {
- XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
- prefs.removeEmptyLines = true;
-
- check(
- // Before
- "<root>\r\n" +
- "\r\n" +
- "\r\n" +
- "[ <element/>\r\n" +
- " <second/>\r\n" +
- "]\r\n" +
- "\r\n" +
- "\r\n" +
- "</root>\r\n",
-
- // Insert
- " <element/>\r\n" +
- " <second/>\r\n",
-
- // After
- "<root>\r\n" +
- " <element/>\r\n" +
- " <second/>\r\n" +
- "</root>\r\n",
-
- prefs);
- }
-
- public void testCrLf3() throws Exception {
- XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
- prefs.removeEmptyLines = true;
-
- check(
- // Before
- "<root>\r\n" +
- "\r\n" +
- "\r\n" +
- " [<element/>\r\n" +
- " <second/>]\r\n" +
- "\r\n" +
- "\r\n" +
- "\r\n" +
- "</root>\r\n",
-
- // Insert
- " <element/>\r\n" +
- " <second/>",
-
- // After
- "<root>\r\n" +
- " <element/>\r\n" +
- " <second/>\r\n" +
- "</root>\r\n",
-
- prefs);
- }
-
-
- public void testCrlf4() throws Exception {
- check(
- "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n" +
- " xmlns:tools=\"http://schemas.android.com/tools\"\r\n" +
- " android:layout_width=\"match_parent\"\r\n" +
- " android:layout_height=\"match_parent\" >\r\n" +
- "\r\n" +
- " [<TextView\r\n" +
- " android:layout_width=\"wrap_content\"\r\n" +
- " android:layout_height=\"wrap_content\"\r\n" +
- " android:layout_centerHorizontal=\"true\"\r\n" +
- " android:layout_centerVertical=\"true\"\r\n" +
- " android:text=\"foo\"\r\n" +
- " tools:context=\".MainActivity\" />]\r\n" +
- "\r\n" +
- "</RelativeLayout>\r\n",
-
- // Insert
- "\r\n" +
- " <TextView\r\n" +
- " android:layout_width=\"wrap_content\"\r\n" +
- " android:layout_height=\"wrap_content\"\r\n" +
- " android:layout_centerHorizontal=\"true\"\r\n" +
- " android:layout_centerVertical=\"true\"\r\n" +
- " android:text=\"foo\"\r\n" +
- " tools:context=\".MainActivity\" />\r\n",
-
- // After
- "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n" +
- " xmlns:tools=\"http://schemas.android.com/tools\"\r\n" +
- " android:layout_width=\"match_parent\"\r\n" +
- " android:layout_height=\"match_parent\" >\r\n" +
- "\r\n" +
- " <TextView\r\n" +
- " android:layout_width=\"wrap_content\"\r\n" +
- " android:layout_height=\"wrap_content\"\r\n" +
- " android:layout_centerHorizontal=\"true\"\r\n" +
- " android:layout_centerVertical=\"true\"\r\n" +
- " android:text=\"foo\"\r\n" +
- " tools:context=\".MainActivity\" />\r\n" +
- "\r\n" +
- "</RelativeLayout>\r\n",
-
- XmlFormatPreferences.defaults());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/ExplodeRenderingHelperTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/ExplodeRenderingHelperTest.java
deleted file mode 100644
index 0e528674a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/ExplodeRenderingHelperTest.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.internal.editors.mock.MockXmlNode;
-
-import org.w3c.dom.Node;
-
-import java.util.HashSet;
-
-import junit.framework.TestCase;
-
-public class ExplodeRenderingHelperTest extends TestCase {
-
- private final HashSet<String> mLayoutNames = new HashSet<String>();
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- mLayoutNames.add("LinearLayout");
- mLayoutNames.add("RelativeLayout");
- }
-
- public void testSingleHorizontalLinearLayout() {
- // Single layout, horizontal, 2 buttons.
- MockXmlNode layout = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton()} );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(1, helper.getHeightPadding());
- assertEquals(1, helper.getWidthPadding());
- }
-
- public void testSingleVerticalLinearLayout() {
- // Single layout, horizontal, with 2 buttons.
- // LinearLayout(H:[Button Button])
- MockXmlNode layout = createLinearLayout(false /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton()} );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(1, helper.getWidthPadding());
- assertEquals(1, helper.getHeightPadding());
- }
-
- public void testEmbeddedLinearLayouts() {
- /*
- * LinearLayout(vertical):
- * LinearLayout(H:[Button Button])
- * LinearLayout(H:[Button Button Button])
- *
- * Result should be 2 in x, 3 in y
- */
- MockXmlNode layout = createLinearLayout(false /*horizontal*/,
- new MockXmlNode[] {
- createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton()}),
- createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton(), createButton()}),
- } );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(2, helper.getWidthPadding());
- assertEquals(3, helper.getHeightPadding());
- }
-
- public void testSimpleRelativeLayoutWithOneLinearLayouts() {
- /*
- * RelativeLayout:
- * LinearLayout(H:[Button Button])
- *
- * Result should be 2 in x, 2 in y
- */
- MockXmlNode layout = createRelativeLayout(
- new MockXmlNode[] {
- createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton()}),
- } );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(2, helper.getWidthPadding());
- assertEquals(2, helper.getHeightPadding());
- }
-
- public void /*test*/RelativeLayoutWithVerticalLinearLayouts() {
- //FIXME: Reenable once the relative layout are properly supported.
- /*
- * Children of the relative layouts, one below the other.
- * Each with only buttons in them.
- * RelativeLayout:
- * LinearLayout(H:[Button Button])
- * ^
- * LinearLayout(H:[Button Button])
- *
- * Result should be 2 in x, 3 in y
- */
-
- // create the linearlayouts.
- MockXmlNode linear1 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton()});
- linear1.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear1");
-
- MockXmlNode linear2 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton()});
- linear2.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear2");
-
- // position linear2 below linear1
- linear2.addAttributes(SdkConstants.NS_RESOURCES, "layout_below", "@+id/linear1");
-
-
- MockXmlNode layout = createRelativeLayout(new MockXmlNode[] { linear1, linear2 } );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(2, helper.getWidthPadding());
- assertEquals(3, helper.getHeightPadding());
- }
-
- public void /*test*/RelativeLayoutWithVerticalLinearLayouts2() {
- //FIXME: Reenable once the relative layout are properly supported.
- /*
- * Children of the relative layouts, one above the other.
- * Each with only buttons in them.
- * RelativeLayout:
- * LinearLayout(H:[Button Button])
- * v
- * LinearLayout(H:[Button Button])
- *
- * Result should be 2 in x, 3 in y
- */
-
- // create the linearlayouts.
- MockXmlNode linear1 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton() } );
- linear1.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear1");
-
- MockXmlNode linear2 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton(), createButton() } );
- linear2.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear2");
-
- // position linear2 below linear1
- linear2.addAttributes(SdkConstants.NS_RESOURCES, "layout_above", "@+id/linear1");
-
-
- MockXmlNode layout = createRelativeLayout(new MockXmlNode[] { linear1, linear2 } );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(2, helper.getWidthPadding());
- assertEquals(3, helper.getHeightPadding());
- }
-
- public void /*test*/ComplexRelativeLayout() {
- //FIXME: Reenable once the relative layout are properly supported.
- /*
- * RelativeLayout:
- *
- * < LinearLayout1(V: [button]) > LinearLayout2(V: [button])
- * v
- * Button1 > LinearLayout3(V: [button]) < Button2
- * v
- * < LinearLayout4(V: [button])
- * ^
- * <LinearLayout5(V: [button])
- *
- * Result should be 4 in x, 5 in y
- */
-
- // create the elements
- MockXmlNode button1 = createButton();
- button1.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/button1");
-
- MockXmlNode button2 = createButton();
- button2.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/button2");
-
- MockXmlNode linear1 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton() } );
- linear1.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear1");
-
- MockXmlNode linear2 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton() } );
- linear2.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear2");
-
- MockXmlNode linear3 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton() } );
- linear3.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear3");
-
- MockXmlNode linear4 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton() } );
- linear4.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear4");
-
- MockXmlNode linear5 = createLinearLayout(true /*horizontal*/,
- new MockXmlNode[] { createButton() } );
- linear5.addAttributes(SdkConstants.NS_RESOURCES, "id", "@+id/linear5");
-
-
- // link them
- button1.addAttributes(SdkConstants.NS_RESOURCES, "layout_toLeftOf", "@+id/linear3");
-
- button2.addAttributes(SdkConstants.NS_RESOURCES, "layout_toRightOf", "@+id/linear3");
-
- linear1.addAttributes(SdkConstants.NS_RESOURCES, "layout_toRightOf", "@+id/linear3");
- linear1.addAttributes(SdkConstants.NS_RESOURCES, "layout_toLeftOf", "@+id/linear2");
- linear1.addAttributes(SdkConstants.NS_RESOURCES, "layout_above", "@+id/button2");
-
- linear3.addAttributes(SdkConstants.NS_RESOURCES, "layout_above", "@+id/linear4");
-
- linear4.addAttributes(SdkConstants.NS_RESOURCES, "layout_toRightOf", "@+id/button1");
-
- linear5.addAttributes(SdkConstants.NS_RESOURCES, "layout_toRightOf", "@+id/linear4");
- linear5.addAttributes(SdkConstants.NS_RESOURCES, "layout_below", "@+id/linear4");
-
- MockXmlNode layout = createRelativeLayout(
- new MockXmlNode[] {
- button1, button2, linear1, linear2, linear3, linear4, linear5 } );
-
- ExplodedRenderingHelper helper = new ExplodedRenderingHelper(layout, mLayoutNames);
- assertEquals(4, helper.getWidthPadding());
- assertEquals(5, helper.getHeightPadding());
- }
-
-
- // ----- helper to deal with mocks
-
- private MockXmlNode createButton() {
- return new MockXmlNode(null, "Button", Node.ELEMENT_NODE, null);
- }
-
- private MockXmlNode createLinearLayout(boolean horizontal, MockXmlNode[] children) {
- MockXmlNode layout = new MockXmlNode(null, "LinearLayout", Node.ELEMENT_NODE, children);
-
- layout.addAttributes(SdkConstants.NS_RESOURCES, "orientation",
- horizontal ? "horizontal" : "vertical");
-
- return layout;
- }
-
- private MockXmlNode createRelativeLayout(MockXmlNode[] children) {
- MockXmlNode layout = new MockXmlNode(null, "RelativeLayout", Node.ELEMENT_NODE, children);
-
- return layout;
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java
deleted file mode 100644
index 5cac663d7..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2008 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.editors.layout;
-
-import com.android.SdkConstants;
-import com.android.ide.common.api.IAttributeInfo.Format;
-import com.android.ide.common.resources.platform.AttributeInfo;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.TextAttributeDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.mock.MockXmlNode;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-import com.android.resources.Density;
-
-import org.w3c.dom.Node;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-public class UiElementPullParserTest extends TestCase {
-
- private UiElementNode ui;
- private HashMap<String, String> button1Map;
- private HashMap<String, String> button2Map;
- private HashMap<String, String> textMap;
-
- private TextAttributeDescriptor createTextAttrDesc(String xmlName) {
- return new TextAttributeDescriptor(
- xmlName, // xmlLocalName
- SdkConstants.NS_RESOURCES,
- new AttributeInfo(xmlName, Format.STRING_SET)
- );
- }
-
- @Override
- protected void setUp() throws Exception {
- // set up some basic descriptors.
- // We have button, textview, linear layout, relative layout.
- // only the layouts have children (all 4 descriptors possible)
- // Also add some dummy attributes.
- ElementDescriptor buttonDescriptor = new ElementDescriptor("Button", "Button", "", "",
- new AttributeDescriptor[] {
- createTextAttrDesc("name"),
- createTextAttrDesc("text"),
- },
- new ElementDescriptor[] {}, false);
-
- ElementDescriptor textDescriptor = new ElementDescriptor("TextView", "TextView", "", "",
- new AttributeDescriptor[] {
- createTextAttrDesc("name"),
- createTextAttrDesc("text"),
- },
- new ElementDescriptor[] {}, false);
-
- ElementDescriptor linearDescriptor = new ElementDescriptor("LinearLayout", "Linear Layout",
- "", "",
- new AttributeDescriptor[] {
- createTextAttrDesc("orientation"),
- },
- new ElementDescriptor[] { }, false);
-
- ElementDescriptor relativeDescriptor = new ElementDescriptor("RelativeLayout",
- "Relative Layout", "", "",
- new AttributeDescriptor[] {
- createTextAttrDesc("orientation"),
- },
- new ElementDescriptor[] { }, false);
-
- ElementDescriptor[] a = new ElementDescriptor[] {
- buttonDescriptor, textDescriptor, linearDescriptor, relativeDescriptor
- };
-
- linearDescriptor.setChildren(a);
- relativeDescriptor.setChildren(a);
-
- // document descriptor
- ElementDescriptor rootDescriptor = new ElementDescriptor("root", "", "", "",
- new AttributeDescriptor[] { }, a, false);
-
-
- ui = new UiElementNode(rootDescriptor);
-
- /* create a dummy XML file.
- * <LinearLayout android:orientation="vertical">
- * <Button android:name="button1" android:text="button1text"/>
- * <RelativeLayout android:orientation="toto">
- * <Button android:name="button2" android:text="button2text"/>
- * <TextView android:name="text1" android:text="text1text"/>
- * </RelativeLayout>
- * </LinearLayout>
- */
- MockXmlNode button1 = new MockXmlNode(null /* namespace */, "Button", Node.ELEMENT_NODE,
- null);
- button1.addAttributes(SdkConstants.NS_RESOURCES, "name", "button1");
- button1.addAttributes(SdkConstants.NS_RESOURCES, "text", "button1text");
-
- // create a map of the attributes we add to the multi-attribute nodes so that
- // we can more easily test the values when we parse the XML.
- // This is due to some attributes showing in a certain order for a node and in a different
- // order in another node. Since the order doesn't matter, we just simplify the test.
- button1Map = new HashMap<String, String>();
- button1Map.put("name", "button1");
- button1Map.put("text", "button1text");
-
- MockXmlNode button2 = new MockXmlNode(null /* namespace */, "Button", Node.ELEMENT_NODE,
- null);
- button2.addAttributes(SdkConstants.NS_RESOURCES, "name", "button2");
- button2.addAttributes(SdkConstants.NS_RESOURCES, "text", "button2text");
-
- button2Map = new HashMap<String, String>();
- button2Map.put("name", "button2");
- button2Map.put("text", "button2text");
-
- MockXmlNode text = new MockXmlNode(null /* namespace */, "TextView", Node.ELEMENT_NODE,
- null);
- text.addAttributes(SdkConstants.NS_RESOURCES, "name", "text1");
- text.addAttributes(SdkConstants.NS_RESOURCES, "text", "text1text");
-
- textMap = new HashMap<String, String>();
- textMap.put("name", "text1");
- textMap.put("text", "text1text");
-
- MockXmlNode relative = new MockXmlNode(null /* namespace */, "RelativeLayout",
- Node.ELEMENT_NODE, new MockXmlNode[] { button2, text });
- relative.addAttributes(SdkConstants.NS_RESOURCES, "orientation", "toto");
-
- MockXmlNode linear = new MockXmlNode(null /* namespace */, "LinearLayout",
- Node.ELEMENT_NODE, new MockXmlNode[] { button1, relative });
- linear.addAttributes(SdkConstants.NS_RESOURCES, "orientation", "vertical");
-
- MockXmlNode root = new MockXmlNode(null /* namespace */, "root", Node.ELEMENT_NODE,
- new MockXmlNode[] { linear });
-
- // put the namespace/prefix in place
- root.setPrefix(SdkConstants.NS_RESOURCES, "android");
-
- // load the xml into the UiElementNode
- ui.loadFromXmlNode(root);
-
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testParser() {
- try {
- // wrap the parser around the ui element node, and start parsing
- UiElementPullParser parser = new UiElementPullParser(
- ui, // model
- false, // explodedView
- null, // explodeNodes
- Density.MEDIUM, // density (default from ConfigurationComposite)
- null // iProject
- );
-
- assertEquals(XmlPullParser.START_DOCUMENT, parser.getEventType());
-
- // top level Linear layout
- assertEquals(XmlPullParser.START_TAG, parser.next());
- assertEquals("LinearLayout", parser.getName());
- assertEquals(1, parser.getAttributeCount());
- assertEquals("orientation", parser.getAttributeName(0));
- assertEquals(SdkConstants.NS_RESOURCES, parser.getAttributeNamespace(0));
- assertEquals("android", parser.getAttributePrefix(0));
- assertEquals("vertical", parser.getAttributeValue(0));
-
- // Button
- assertEquals(XmlPullParser.START_TAG, parser.next());
- assertEquals("Button", parser.getName());
- assertEquals(2, parser.getAttributeCount());
- check(parser, 0, button1Map);
- check(parser, 1, button1Map);
- // end of button
- assertEquals(XmlPullParser.END_TAG, parser.next());
-
- // Relative Layout
- assertEquals(XmlPullParser.START_TAG, parser.next());
- assertEquals("RelativeLayout", parser.getName());
- assertEquals(1, parser.getAttributeCount());
- assertEquals("orientation", parser.getAttributeName(0));
- assertEquals(SdkConstants.NS_RESOURCES, parser.getAttributeNamespace(0));
- assertEquals("android", parser.getAttributePrefix(0));
- assertEquals("toto", parser.getAttributeValue(0));
-
- // Button
- assertEquals(XmlPullParser.START_TAG, parser.next());
- assertEquals("Button", parser.getName());
- assertEquals(2, parser.getAttributeCount());
- check(parser, 0, button2Map);
- check(parser, 1, button2Map);
- // end of button
- assertEquals(XmlPullParser.END_TAG, parser.next());
-
- // TextView
- assertEquals(XmlPullParser.START_TAG, parser.next());
- assertEquals("TextView", parser.getName());
- assertEquals(2, parser.getAttributeCount());
- check(parser, 0, textMap);
- check(parser, 1, textMap);
- // end of TextView
- assertEquals(XmlPullParser.END_TAG, parser.next());
-
- // end of RelativeLayout
- assertEquals(XmlPullParser.END_TAG, parser.next());
-
-
- // end of top level linear layout
- assertEquals(XmlPullParser.END_TAG, parser.next());
-
- assertEquals(XmlPullParser.END_DOCUMENT, parser.next());
- } catch (XmlPullParserException e) {
- e.printStackTrace();
- assertTrue(false);
- }
- }
-
- /**
- * Receives a {@link XmlPullParser} at the START_TAG level, and checks the i-th attribute
- * to be present in the {@link HashMap} with the proper (name, value)
- * @param parser
- * @param i
- * @param map
- */
- private void check(UiElementPullParser parser, int i, HashMap<String, String> map) {
- String name = parser.getAttributeName(i);
- String value = parser.getAttributeValue(i);
-
- String referenceValue = map.get(name);
- assertNotNull(referenceValue);
- assertEquals(referenceValue, value);
-
- assertEquals(SdkConstants.NS_RESOURCES, parser.getAttributeNamespace(i));
- assertEquals("android", parser.getAttributePrefix(i));
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java
deleted file mode 100644
index 5b07d7b88..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.editors.layout.configuration;
-
-import static com.android.ide.common.resources.configuration.LocaleQualifier.FAKE_VALUE;
-
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.common.resources.configuration.LocaleQualifier;
-import com.android.resources.Density;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.devices.Screen;
-import com.android.utils.StdLogger;
-import com.google.common.collect.Lists;
-
-import java.lang.reflect.Constructor;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class ConfigurationTest extends TestCase {
- private Configuration createConfiguration() throws Exception {
- // Using reflection instead since we want to pass null to
- // a constructor marked with @NonNull, so the test won't compile.
- Constructor<Configuration> constructor =
- Configuration.class.getDeclaredConstructor(ConfigurationChooser.class);
- constructor.setAccessible(true);
- ConfigurationChooser chooser = null;
- return constructor.newInstance(chooser);
- }
-
- public void test() throws Exception {
- Configuration configuration = createConfiguration();
- assertNotNull(configuration);
- configuration.setTheme("@style/Theme");
- assertEquals("@style/Theme", configuration.getTheme());
-
- DeviceManager deviceManager = DeviceManager.createInstance(
- null /*osSdkPath*/,
- new StdLogger(StdLogger.Level.VERBOSE));
- Collection<Device> devices = deviceManager.getDevices(DeviceManager.DeviceFilter.DEFAULT);
- assertNotNull(devices);
- assertTrue(devices.size() > 0);
- configuration.setDevice(devices.iterator().next(), false);
-
- // Check syncing
- FolderConfiguration folderConfig = configuration.getFullConfig();
- assertEquals(FAKE_VALUE, folderConfig.getLocaleQualifier().getLanguage());
- assertEquals(FAKE_VALUE, folderConfig.getLocaleQualifier().getRegion());
- assertEquals(Locale.ANY, configuration.getLocale());
-
- Locale language = Locale.create(new LocaleQualifier("nb"));
- configuration.setLocale(language, true /* skipSync */);
- assertEquals(FAKE_VALUE, folderConfig.getLocaleQualifier().getLanguage());
- assertEquals(FAKE_VALUE, folderConfig.getLocaleQualifier().getRegion());
-
- configuration.setLocale(language, false /* skipSync */);
- assertEquals(FAKE_VALUE, folderConfig.getLocaleQualifier().getRegion());
- assertEquals("nb", folderConfig.getLocaleQualifier().getLanguage());
-
- assertEquals("2.7in QVGA::nb-__:+Theme::notnight::", configuration.toPersistentString());
-
- configuration.setActivity("foo.bar.FooActivity");
- configuration.setTheme("@android:style/Theme.Holo.Light");
-
- assertEquals("2.7in QVGA",
- ConfigurationChooser.getDeviceLabel(configuration.getDevice(), true));
- assertEquals("2.7in QVGA",
- ConfigurationChooser.getDeviceLabel(configuration.getDevice(), false));
- assertEquals("Light",
- ConfigurationChooser.getThemeLabel(configuration.getTheme(), true));
- assertEquals("Theme.Holo.Light",
- ConfigurationChooser.getThemeLabel(configuration.getTheme(), false));
- assertEquals("nb",
- ConfigurationChooser.getLocaleLabel(null, configuration.getLocale(), true));
- assertEquals("Norwegian Bokm\u00e5l (nb)",
- ConfigurationChooser.getLocaleLabel(null, configuration.getLocale(), false));
-
- assertEquals("FooActivity",
- ConfigurationChooser.getActivityLabel(configuration.getActivity(), true));
- assertEquals("foo.bar.FooActivity",
- ConfigurationChooser.getActivityLabel(configuration.getActivity(), false));
-
- assertEquals("2.7in QVGA::nb-__:-Theme.Holo.Light::notnight::foo.bar.FooActivity",
- configuration.toPersistentString());
-
- assertEquals(Density.MEDIUM, configuration.getDensity());
- Screen screen = configuration.getDevice().getDefaultHardware().getScreen();
- assertEquals(145.0f, screen.getXdpi(), 0.001);
- assertEquals(145.0f, screen.getYdpi(), 0.001);
- }
-
- public void testCopy() throws Exception {
- Configuration configuration = createConfiguration();
- assertNotNull(configuration);
- configuration.setTheme("@style/Theme");
- assertEquals("@style/Theme", configuration.getTheme());
- DeviceManager deviceManager = DeviceManager.createInstance(
- null /*osSdkPath*/,
- new StdLogger(StdLogger.Level.VERBOSE));
- List<Device> devices = Lists.newArrayList(deviceManager.getDevices(DeviceManager.DeviceFilter.DEFAULT));
- assertNotNull(devices);
- assertTrue(devices.size() > 0);
- configuration.setDevice(devices.get(0), false);
- configuration.setActivity("foo.bar.FooActivity");
- configuration.setTheme("@android:style/Theme.Holo.Light");
- Locale locale = Locale.create(new LocaleQualifier("nb"));
- configuration.setLocale(locale, false /* skipSync */);
-
- Configuration copy = Configuration.copy(configuration);
- assertEquals(locale, copy.getLocale());
- assertEquals("foo.bar.FooActivity", copy.getActivity());
- assertEquals("@android:style/Theme.Holo.Light", copy.getTheme());
- assertEquals(devices.get(0), copy.getDevice());
-
- // Make sure edits to master does not affect the child
- configuration.setLocale(Locale.ANY, false);
- configuration.setTheme("@android:style/Theme.Holo");
- configuration.setDevice(devices.get(1), true);
-
- assertTrue(copy.getFullConfig().getLocaleQualifier().equals(locale.qualifier));
- assertEquals(locale, copy.getLocale());
- assertEquals("foo.bar.FooActivity", copy.getActivity());
- assertEquals("@android:style/Theme.Holo.Light", copy.getTheme());
- assertEquals(devices.get(0), copy.getDevice());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManagerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManagerTest.java
deleted file mode 100644
index 4286aaa30..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/FlagManagerTest.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * 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.editors.layout.configuration;
-
-import com.android.SdkConstants;
-import com.android.ide.common.resources.LocaleManager;
-import com.google.common.base.Function;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-
-import org.eclipse.swt.graphics.Image;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FlagManagerTest extends TestCase {
- public void testGetFlagImage() {
- FlagManager manager = FlagManager.get();
- Image us = manager.getFlag("US");
- Image gb = manager.getFlag("GB");
- Image ca = manager.getFlag("CA");
- Image es = manager.getFlag("ES");
- Image br = manager.getFlag("BR");
- Image pt = manager.getFlag("PT");
- assertSame(us, manager.getFlag("en", "US"));
- assertSame(gb, manager.getFlag("en", "GB"));
- assertSame(ca, manager.getFlag("en", "CA"));
- Locale.setDefault(Locale.US);
- assertSame(us, manager.getFlag("en", null));
- Locale.setDefault(Locale.UK);
- assertSame(gb, manager.getFlag("en", null));
- Locale.setDefault(Locale.CANADA);
- assertSame(ca, manager.getFlag("en", null));
- assertSame(manager.getFlag("NO"), manager.getFlag("nb", null));
- assertSame(manager.getFlag("FR"), manager.getFlag("fr", null));
-
- Locale.setDefault(new Locale("pt", "br"));
- assertSame(br, manager.getFlag("pt", null));
- assertSame(pt, manager.getFlag("pt", "PT"));
- Locale.setDefault(new Locale("pt", "pt"));
- assertSame(pt, manager.getFlag("pt", null));
- assertSame(br, manager.getFlag("pt", "BR"));
-
- // Special cases where we have custom flags
- assertNotSame(gb, manager.getFlag("cy", null)); // Wales
- assertNotSame(es, manager.getFlag("ca", null)); // Catalonia
-
- // Aliases - http://developer.android.com/reference/java/util/Locale.html
- assertSame(manager.getFlag("yi", null), manager.getFlag("ji", null));
- assertSame(manager.getFlag("in", null), manager.getFlag("id", null));
- assertSame(manager.getFlag("iw", null), manager.getFlag("he", null));
- assertSame(us, manager.getFlagForFolderName("values-en-rUS"));
- assertSame(gb, manager.getFlagForFolderName("values-en-rGB"));
- Locale.setDefault(Locale.CANADA);
- assertSame(ca, manager.getFlagForFolderName("values-en"));
- }
-
- public void testAvailableImages() {
- // Images we have from WindowBuilder (which are really the famfamfam
- // icons;
- // see http://www.famfamfam.com/lab/icons/flags)
- String[] icons = new String[] {
- "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "as", "at", "au", "aw", "ax",
- "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo", "br",
- "bs", "bt", "bv", "bw", "by", "bz", "ca", "catalonia", "cc", "cd", "cf", "cg",
- "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr", "cu", "cv", "cx", "cy", "cz", "de",
- "dj", "dk", "dm", "do", "dz", "ec", "ee", "eg", "eh", "england", "er", "es", "et",
- "fi", "fj", "fk", "fm", "fo", "fr", "ga", "gb", "gd", "ge", "gf", "gg", "gh", "gi",
- "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy", "hk", "hm", "hn",
- "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it", "jm",
- "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn", "kp", "kr", "kw", "ky", "kz", "la",
- "lb", "lc", "li", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
- "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv",
- "mw", "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr",
- "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm", "pn", "pr", "ps",
- "pt", "pw", "py", "qa", "re", "ro", "rs", "ru", "rw", "sa", "sb", "sc", "scotland",
- "sd", "se", "sg", "sh", "si", "sj", "sk", "sl", "sm", "sn", "so", "sr", "ss", "st",
- "sv", "sy", "sz", "tc", "td", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to",
- "tr", "tt", "tv", "tw", "tz", "ua", "ug", "um", "us", "uy", "uz", "va", "vc", "ve",
- "vg", "vi", "vn", "vu", "wales", "wf", "ws", "ye", "yt", "za", "zm", "zw"
- };
-
- Set<String> sImages = new HashSet<String>(100);
- for (String code : icons) {
- if (code.length() > 2) {
- continue;
- }
- code = code.toUpperCase(Locale.US);
- sImages.add(code);
-
- if (!LocaleManager.isValidRegionCode(code)) {
- System.out.println("No region name found for region code " + code);
- }
- }
-
- Set<String> unused = Sets.newHashSet(LocaleManager.getRegionCodes(false));
- Set<String> reachable = Sets.newHashSet();
- Multimap<String, String> regionToLanguages = ArrayListMultimap.create();
- for (String language : LocaleManager.getLanguageCodes(false)) {
- for (String region : LocaleManager.getRelevantRegions(language)) {
- reachable.add(region);
- regionToLanguages.put(region, language);
- }
- }
- unused.removeAll(reachable);
-
- for (String region : reachable) {
- if (!sImages.contains(region)) {
- StringBuilder sb = new StringBuilder();
-
- sb.append("No icon found for region ").append(region).append(" ")
- .append(LocaleManager.getRegionName(region));
- sb.append(", used for languages ");
-
- for (String language : regionToLanguages.get(region)) {
- sb.append(language).append("(").append(LocaleManager.getLanguageName(language))
- .append(") ");
- }
- System.out.println(sb.toString());
- }
- }
-
- // Known regions that we don't have language to region mappings for
- unused.remove("AQ");
- unused.remove("VA");
- unused.remove("GS");
- unused.remove("TF");
- unused.remove("BV");
- unused.remove("HM");
-
- if (!unused.isEmpty()) {
- StringBuilder sb = new StringBuilder();
- sb.append("The following icons are not referenced by any of the "
- + "language to country bindings:");
- for (String code : unused) {
- sb.append(code.toLowerCase(Locale.US)).append(SdkConstants.DOT_PNG).append(" (");
- sb.append(LocaleManager.getRegionName(code)).append(") ");
- }
- System.out.println(sb.toString());
- }
- }
-
- public void testMissingFlag() {
- Image icon = FlagManager.get().getFlag("AQ");
- assertNotNull(icon);
- assertSame(FlagManager.get().getEmptyIcon(), icon);
-
- icon = FlagManager.get().getFlag("AQ");
- assertNotNull(icon);
- assertSame(FlagManager.get().getEmptyIcon(), icon);
-
- icon = FlagManager.get().getFlag("WO"); // Not used in ISO 3166-1
- assertNotNull(icon);
- assertSame(FlagManager.get().getEmptyIcon(), icon);
- }
-
- public void testKnownFlag() {
- Image icon = FlagManager.get().getFlag("US");
- assertNotNull(icon);
- assertNotSame(FlagManager.get().getEmptyIcon(), icon);
- }
-}
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleTest.java
deleted file mode 100644
index 904ade39c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.editors.layout.configuration;
-
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.common.resources.configuration.LocaleQualifier;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class LocaleTest extends TestCase {
- public void test1() {
- Locale locale = Locale.create("en-rUS");
- assertEquals("en", locale.qualifier.getLanguage());
- assertEquals("US", locale.qualifier.getRegion());
- assertTrue(locale.hasLanguage());
- assertTrue(locale.hasRegion());
- }
-
- public void test2() {
- Locale locale = Locale.create("zh");
- assertEquals("zh", locale.qualifier.getLanguage());
- assertNull(locale.qualifier.getRegion());
- assertTrue(locale.hasLanguage());
- assertFalse(locale.hasRegion());
- }
-
- public void testEquals() {
- Locale locale = Locale.create("zh");
- assertEquals("zh", locale.qualifier.getLanguage());
- assertNull(locale.qualifier.getRegion());
- assertTrue(locale.hasLanguage());
- assertFalse(locale.hasRegion());
- }
-
- public void test() {
- LocaleQualifier qualifier1 = LocaleQualifier.getQualifier("nb");
- LocaleQualifier qualifier2 = LocaleQualifier.getQualifier("no");
- LocaleQualifier qualifier3 = LocaleQualifier.getQualifier("nb-rNO");
- LocaleQualifier qualifier4 = LocaleQualifier.getQualifier("nb-rSE");
- LocaleQualifier qualifier5 = LocaleQualifier.getQualifier("no-rSE");
- assertNotNull(qualifier1);
- assertNotNull(qualifier2);
- assertNotNull(qualifier3);
- assertNotNull(qualifier4);
- assertNotNull(qualifier5);
-
- assertEquals(Locale.ANY, Locale.ANY);
- assertFalse(Locale.ANY.hasLanguage());
- assertFalse(Locale.ANY.hasRegion());
- // noinspection ConstantConditions
- assertFalse(Locale.create(new LocaleQualifier(LocaleQualifier.FAKE_VALUE)).hasLanguage());
- // noinspection ConstantConditions
- assertFalse(Locale.create(new LocaleQualifier(LocaleQualifier.FAKE_VALUE)).hasRegion());
-
- assertEquals(Locale.create(qualifier1), Locale.create(qualifier1));
- assertTrue(Locale.create(qualifier1).hasLanguage());
- assertFalse(Locale.create(qualifier1).hasRegion());
- assertTrue(Locale.create(qualifier3).hasLanguage());
- assertTrue(Locale.create(qualifier3).hasRegion());
-
- assertEquals(Locale.create(qualifier3), Locale.create(qualifier3));
- assertEquals(Locale.create(qualifier1), Locale.create(qualifier1));
- assertTrue(Locale.create(qualifier1).equals(Locale.create(qualifier1)));
- assertTrue(Locale.create(qualifier3).equals(Locale.create(qualifier3)));
- assertFalse(Locale.create(qualifier3).equals(Locale.create(qualifier4)));
- assertFalse(Locale.create(qualifier1).equals(Locale.create(qualifier3)));
- assertFalse(Locale.create(qualifier1).equals(Locale.create(qualifier2)));
- assertFalse(Locale.create(qualifier3).equals(Locale.create(qualifier5)));
- assertEquals("nb", Locale.create(qualifier1).toString());
- assertEquals("nb-NO", Locale.create(qualifier3).toString());
-
- assertEquals(Locale.create(qualifier1), Locale.create("b+nb"));
- assertEquals(Locale.create(qualifier3), Locale.create("b+nb+NO"));
- }
-
- public void testFolderConfig() {
- FolderConfiguration config = new FolderConfiguration();
- assertEquals(Locale.ANY, Locale.create(config));
- config.setLocaleQualifier(LocaleQualifier.getQualifier("en"));
- assertEquals(Locale.create("en"), Locale.create(config));
- config.setLocaleQualifier(LocaleQualifier.getQualifier("en-rUS"));
- assertEquals(Locale.create("en-rUS"), Locale.create(config));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfoTest.java
deleted file mode 100644
index 5996f01c0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfoTest.java
+++ /dev/null
@@ -1,797 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import com.android.ide.common.rendering.api.Capability;
-import com.android.ide.common.rendering.api.DataBindingItem;
-import com.android.ide.common.rendering.api.MergeCookie;
-import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
-import com.android.utils.Pair;
-
-import org.eclipse.swt.graphics.Rectangle;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class CanvasViewInfoTest extends TestCase {
-
- public static ViewElementDescriptor createDesc(String name, String fqn, boolean hasChildren) {
- if (hasChildren) {
- return new ViewElementDescriptor(name, name, fqn, "", "", new AttributeDescriptor[0],
- new AttributeDescriptor[0], new ElementDescriptor[1], false);
- } else {
- return new ViewElementDescriptor(name, fqn);
- }
- }
-
- public static UiViewElementNode createNode(UiViewElementNode parent, String fqn,
- boolean hasChildren) {
- String name = fqn.substring(fqn.lastIndexOf('.') + 1);
- ViewElementDescriptor descriptor = createDesc(name, fqn, hasChildren);
- if (parent == null) {
- // All node hierarchies should be wrapped inside a document node at the root
- parent = new UiViewElementNode(createDesc("doc", "doc", true));
- }
- return (UiViewElementNode) parent.appendNewUiChild(descriptor);
- }
-
- public static UiViewElementNode createNode(String fqn, boolean hasChildren) {
- return createNode(null, fqn, hasChildren);
- }
-
- public void testNormalCreate() throws Exception {
- normal(true);
- }
-
- public void testNormalCreateLayoutLib5() throws Exception {
- normal(false);
- }
-
- private void normal(boolean layoutlib5) {
-
- // Normal view hierarchy, no null keys anywhere
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = createNode(rootNode, "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("Button", child1Node, 0, 0, 50, 20);
- UiViewElementNode child2Node = createNode(rootNode, "android.widget.Button", false);
- ViewInfo child2 = new ViewInfo("Button", child2Node, 0, 20, 70, 25);
- root.setChildren(Arrays.asList(child1, child2));
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("LinearLayout", rootView.getName());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertSame(rootView.getUiViewNode(), rootNode);
- assertEquals(2, rootView.getChildren().size());
- CanvasViewInfo childView1 = rootView.getChildren().get(0);
- CanvasViewInfo childView2 = rootView.getChildren().get(1);
-
- assertEquals("Button", childView1.getName());
- assertSame(rootView, childView1.getParent());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getAbsRect());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getSelectionRect());
- assertSame(childView1.getUiViewNode(), child1Node);
-
- assertEquals("Button", childView2.getName());
- assertSame(rootView, childView2.getParent());
- assertEquals(new Rectangle(10, 30, 69, 4), childView2.getAbsRect());
- assertEquals(new Rectangle(10, 30, 69, 5), childView2.getSelectionRect());
- assertSame(childView2.getUiViewNode(), child2Node);
- }
-
- public void testShowIn() throws Exception {
- showIn(false);
- }
-
- public void testShowInLayoutLib5() throws Exception {
- showIn(true);
- }
-
- public void showIn(boolean layoutlib5) throws Exception {
-
- // Test rendering of "Show Included In" (included content rendered
- // within an outer content that has null keys)
-
- ViewInfo root = new ViewInfo("LinearLayout", null, 10, 10, 100, 100);
- ViewInfo child1 = new ViewInfo("CheckBox", null, 0, 0, 50, 20);
- UiViewElementNode child2Node = createNode("android.widget.RelativeLayout", true);
- ViewInfo child2 = new ViewInfo("RelativeLayout", child2Node, 0, 20, 70, 25);
- root.setChildren(Arrays.asList(child1, child2));
- UiViewElementNode child21Node = createNode("android.widget.Button", false);
- ViewInfo child21 = new ViewInfo("RadioButton", child21Node, 0, 20, 70, 25);
- child2.setChildren(Arrays.asList(child21));
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("LinearLayout", rootView.getName());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertNull(rootView.getUiViewNode());
- assertEquals(1, rootView.getChildren().size());
- CanvasViewInfo includedView = rootView.getChildren().get(0);
-
- assertEquals("RelativeLayout", includedView.getName());
- assertSame(rootView, includedView.getParent());
- assertEquals(new Rectangle(10, 30, 69, 4), includedView.getAbsRect());
- assertEquals(new Rectangle(10, 30, 69, 5), includedView.getSelectionRect());
- assertSame(includedView.getUiViewNode(), child2Node);
-
- CanvasViewInfo grandChild = includedView.getChildren().get(0);
- assertNotNull(grandChild);
- assertEquals("RadioButton", grandChild.getName());
- assertSame(child21Node, grandChild.getUiViewNode());
- assertEquals(new Rectangle(10, 50, 69, 4), grandChild.getAbsRect());
- assertEquals(new Rectangle(10, 50, 69, 5), grandChild.getSelectionRect());
- }
-
- public void testIncludeTag() throws Exception {
- boolean layoutlib5 = true;
-
- // Test rendering of included views on layoutlib 5+ (e.g. has <include> tag)
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = createNode(rootNode, "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("CheckBox", child1Node, 0, 0, 50, 20);
- UiViewElementNode child2Node = createNode(rootNode, "include", true);
- ViewInfo child2 = new ViewInfo("RelativeLayout", child2Node, 0, 20, 70, 25);
- root.setChildren(Arrays.asList(child1, child2));
- ViewInfo child21 = new ViewInfo("RadioButton", null, 0, 20, 70, 25);
- child2.setChildren(Arrays.asList(child21));
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("LinearLayout", rootView.getName());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(2, rootView.getChildren().size());
-
- CanvasViewInfo childView1 = rootView.getChildren().get(0);
- CanvasViewInfo includedView = rootView.getChildren().get(1);
-
- assertEquals("CheckBox", childView1.getName());
- assertSame(rootView, childView1.getParent());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getAbsRect());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getSelectionRect());
- assertSame(childView1.getUiViewNode(), child1Node);
-
- assertEquals("RelativeLayout", includedView.getName());
- assertSame(rootView, includedView.getParent());
- assertEquals(new Rectangle(10, 30, 69, 4), includedView.getAbsRect());
- assertEquals(new Rectangle(10, 30, 69, 5), includedView.getSelectionRect());
- assertSame(includedView.getUiViewNode(), child2Node);
- assertEquals(0, includedView.getChildren().size());
- }
-
- public void testNoIncludeTag() throws Exception {
- boolean layoutlib5 = false;
-
- // Test rendering of included views on layoutlib 4- (e.g. no <include> tag cookie
- // in view info)
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = createNode(rootNode, "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("CheckBox", child1Node, 0, 0, 50, 20);
- UiViewElementNode child2Node = createNode(rootNode, "include", true);
- ViewInfo child2 = new ViewInfo("RelativeLayout", null /* layoutlib 4 */, 0, 20, 70, 25);
- root.setChildren(Arrays.asList(child1, child2));
- ViewInfo child21 = new ViewInfo("RadioButton", null, 0, 20, 70, 25);
- child2.setChildren(Arrays.asList(child21));
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("LinearLayout", rootView.getName());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(2, rootView.getChildren().size());
-
- CanvasViewInfo childView1 = rootView.getChildren().get(0);
- CanvasViewInfo includedView = rootView.getChildren().get(1);
-
- assertEquals("CheckBox", childView1.getName());
- assertSame(rootView, childView1.getParent());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getAbsRect());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getSelectionRect());
- assertSame(childView1.getUiViewNode(), child1Node);
-
- assertEquals("RelativeLayout", includedView.getName());
- assertSame(rootView, includedView.getParent());
- assertEquals(new Rectangle(10, 30, 69, 4), includedView.getAbsRect());
- assertEquals(new Rectangle(10, 30, 69, 5), includedView.getSelectionRect());
- assertSame(includedView.getUiViewNode(), child2Node);
- assertEquals(0, includedView.getChildren().size());
- }
-
- public void testMergeMatching() throws Exception {
- boolean layoutlib5 = false;
-
- // Test rendering of MULTIPLE included views or when there is no simple match
- // between view info and ui element node children
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = createNode(rootNode, "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("CheckBox", child1Node, 0, 0, 50, 20);
- UiViewElementNode multiChildNode1 = createNode(rootNode, "foo", true);
- UiViewElementNode multiChildNode2 = createNode(rootNode, "bar", true);
- ViewInfo child2 = new ViewInfo("RelativeLayout", null, 0, 20, 70, 25);
- ViewInfo child3 = new ViewInfo("AbsoluteLayout", null, 10, 40, 50, 15);
- root.setChildren(Arrays.asList(child1, child2, child3));
- ViewInfo child21 = new ViewInfo("RadioButton", null, 0, 20, 70, 25);
- child2.setChildren(Arrays.asList(child21));
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("LinearLayout", rootView.getName());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertTrue(rootView.isRoot());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(3, rootView.getChildren().size());
-
- CanvasViewInfo childView1 = rootView.getChildren().get(0);
- assertFalse(childView1.isRoot());
- CanvasViewInfo includedView1 = rootView.getChildren().get(1);
- assertFalse(includedView1.isRoot());
- CanvasViewInfo includedView2 = rootView.getChildren().get(2);
- assertFalse(includedView1.isRoot());
-
- assertEquals("CheckBox", childView1.getName());
- assertSame(rootView, childView1.getParent());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getAbsRect());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getSelectionRect());
- assertSame(childView1.getUiViewNode(), child1Node);
-
- assertEquals("RelativeLayout", includedView1.getName());
- assertSame(multiChildNode1, includedView1.getUiViewNode());
- assertEquals("foo", includedView1.getUiViewNode().getDescriptor().getXmlName());
- assertSame(multiChildNode2, includedView2.getUiViewNode());
- assertEquals("AbsoluteLayout", includedView2.getName());
- assertEquals("bar", includedView2.getUiViewNode().getDescriptor().getXmlName());
- assertSame(rootView, includedView1.getParent());
- assertSame(rootView, includedView2.getParent());
- assertEquals(new Rectangle(10, 30, 69, 4), includedView1.getAbsRect());
- assertEquals(new Rectangle(10, 30, 69, 5), includedView1.getSelectionRect());
- assertEquals(new Rectangle(20, 50, 39, -26), includedView2.getAbsRect());
- assertEquals(new Rectangle(20, 35, 39, 5), includedView2.getSelectionRect());
- assertEquals(0, includedView1.getChildren().size());
- assertEquals(0, includedView2.getChildren().size());
- }
-
- public void testMerge() throws Exception {
- boolean layoutlib5 = false;
-
- // Test rendering of MULTIPLE included views or when there is no simple match
- // between view info and ui element node children
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = createNode(rootNode, "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("CheckBox", child1Node, 0, 0, 50, 20);
- UiViewElementNode multiChildNode = createNode(rootNode, "foo", true);
- ViewInfo child2 = new ViewInfo("RelativeLayout", null, 0, 20, 70, 25);
- ViewInfo child3 = new ViewInfo("AbsoluteLayout", null, 10, 40, 50, 15);
- root.setChildren(Arrays.asList(child1, child2, child3));
- ViewInfo child21 = new ViewInfo("RadioButton", null, 0, 20, 70, 25);
- child2.setChildren(Arrays.asList(child21));
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("LinearLayout", rootView.getName());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(2, rootView.getChildren().size());
-
- CanvasViewInfo childView1 = rootView.getChildren().get(0);
- CanvasViewInfo includedView = rootView.getChildren().get(1);
-
- assertEquals("CheckBox", childView1.getName());
- assertSame(rootView, childView1.getParent());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getAbsRect());
- assertEquals(new Rectangle(10, 10, 49, 19), childView1.getSelectionRect());
- assertSame(childView1.getUiViewNode(), child1Node);
-
- assertEquals("RelativeLayout", includedView.getName());
- assertSame(rootView, includedView.getParent());
- assertEquals(new Rectangle(10, 30, 69, 4), includedView.getAbsRect());
- assertEquals(new Rectangle(10, 30, 69, 5), includedView.getSelectionRect());
- assertEquals(0, includedView.getChildren().size());
- assertSame(multiChildNode, includedView.getUiViewNode());
- }
-
- public void testInsertMerge() throws Exception {
- boolean layoutlib5 = false;
-
- // Test rendering of MULTIPLE included views or when there is no simple match
- // between view info and ui element node children
-
- UiViewElementNode mergeNode = createNode("merge", true);
- UiViewElementNode rootNode = createNode(mergeNode, "android.widget.Button", false);
- ViewInfo root = new ViewInfo("Button", rootNode, 10, 10, 100, 100);
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("merge", rootView.getName());
- assertSame(rootView.getUiViewNode(), mergeNode);
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), rootView.getSelectionRect());
- assertNull(rootView.getParent());
- assertSame(mergeNode, rootView.getUiViewNode());
- assertEquals(1, rootView.getChildren().size());
-
- CanvasViewInfo childView1 = rootView.getChildren().get(0);
-
- assertEquals("Button", childView1.getName());
- assertSame(rootView, childView1.getParent());
- assertEquals(new Rectangle(10, 10, 89, 89), childView1.getAbsRect());
- assertEquals(new Rectangle(10, 10, 89, 89), childView1.getSelectionRect());
- assertSame(childView1.getUiViewNode(), rootNode);
- }
-
- public void testUnmatchedMissing() throws Exception {
- boolean layoutlib5 = false;
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 0, 0, 100, 100);
- List<ViewInfo> children = new ArrayList<ViewInfo>();
- // Should be matched up with corresponding node:
- Set<Integer> missingKeys = new HashSet<Integer>();
- // Should not be matched with any views, but should get view created:
- Set<Integer> extraKeys = new HashSet<Integer>();
- // Should not be matched with any nodes
- Set<Integer> extraViews = new HashSet<Integer>();
- int numViews = 30;
- missingKeys.add(0);
- missingKeys.add(4);
- missingKeys.add(14);
- missingKeys.add(29);
- extraKeys.add(9);
- extraKeys.add(20);
- extraKeys.add(22);
- extraViews.add(18);
- extraViews.add(24);
-
- List<String> expectedViewNames = new ArrayList<String>();
- List<String> expectedNodeNames = new ArrayList<String>();
-
- for (int i = 0; i < numViews; i++) {
- UiViewElementNode childNode = null;
- if (!extraViews.contains(i)) {
- childNode = createNode(rootNode, "childNode" + i, false);
- }
- Object cookie = missingKeys.contains(i) || extraViews.contains(i) ? null : childNode;
- ViewInfo childView = new ViewInfo("childView" + i, cookie,
- 0, i * 20, 50, (i + 1) * 20);
- children.add(childView);
-
- if (!extraViews.contains(i)) {
- expectedViewNames.add("childView" + i);
- expectedNodeNames.add("childNode" + i);
- }
-
- if (extraKeys.contains(i)) {
- createNode(rootNode, "extraNodeAt" + i, false);
-
- expectedViewNames.add("extraNodeAt" + i);
- expectedNodeNames.add("extraNodeAt" + i);
- }
- }
- root.setChildren(children);
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
-
- // dump(root, 0);
- // dump(rootView, 0);
-
- assertEquals("LinearLayout", rootView.getName());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(numViews + extraKeys.size() - extraViews.size(), rootNode.getUiChildren()
- .size());
- assertEquals(numViews + extraKeys.size() - extraViews.size(),
- rootView.getChildren().size());
- assertEquals(expectedViewNames.size(), rootView.getChildren().size());
- for (int i = 0, n = rootView.getChildren().size(); i < n; i++) {
- CanvasViewInfo childView = rootView.getChildren().get(i);
- String expectedViewName = expectedViewNames.get(i);
- String expectedNodeName = expectedNodeNames.get(i);
- assertEquals(expectedViewName, childView.getName());
- assertNotNull(childView.getUiViewNode());
- assertEquals(expectedNodeName, childView.getUiViewNode().getDescriptor().getXmlName());
- }
- }
-
- public void testMergeCookies() throws Exception {
- boolean layoutlib5 = true;
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 0, 0, 100, 100);
-
- // Create the merge cookies in the opposite order to ensure that we don't
- // apply our own logic when matching up views with nodes
- LinkedList<MergeCookie> cookies = new LinkedList<MergeCookie>();
- for (int i = 0; i < 10; i++) {
- UiViewElementNode node = createNode(rootNode, "childNode" + i, false);
- cookies.addFirst(new MergeCookie(node));
- }
- Iterator<MergeCookie> it = cookies.iterator();
- ArrayList<ViewInfo> children = new ArrayList<ViewInfo>();
- for (int i = 0; i < 10; i++) {
- ViewInfo childView = new ViewInfo("childView" + i, it.next(), 0, i * 20, 50,
- (i + 1) * 20);
- children.add(childView);
- }
- root.setChildren(children);
-
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
-
- assertEquals("LinearLayout", rootView.getName());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- for (int i = 0, n = rootView.getChildren().size(); i < n; i++) {
- CanvasViewInfo childView = rootView.getChildren().get(i);
- assertEquals("childView" + i, childView.getName());
- assertEquals("childNode" + (9 - i), childView.getUiViewNode().getDescriptor()
- .getXmlName());
- }
- }
-
- public void testMergeCookies2() throws Exception {
- boolean layoutlib5 = true;
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 0, 0, 100, 100);
-
- UiViewElementNode node1 = createNode(rootNode, "childNode1", false);
- UiViewElementNode node2 = createNode(rootNode, "childNode2", false);
- MergeCookie cookie1 = new MergeCookie(node1);
- MergeCookie cookie2 = new MergeCookie(node2);
-
- // Sets alternating merge cookies and checks whether the node sibling lists are
- // okay and merged correctly
-
- ArrayList<ViewInfo> children = new ArrayList<ViewInfo>();
- for (int i = 0; i < 10; i++) {
- Object cookie = (i % 2) == 0 ? cookie1 : cookie2;
- ViewInfo childView = new ViewInfo("childView" + i, cookie, 0, i * 20, 50,
- (i + 1) * 20);
- children.add(childView);
- }
- root.setChildren(children);
-
- Pair<CanvasViewInfo, List<Rectangle>> result = CanvasViewInfo.create(root, layoutlib5);
- CanvasViewInfo rootView = result.getFirst();
- List<Rectangle> bounds = result.getSecond();
- assertNull(bounds);
- assertNotNull(rootView);
-
- assertEquals("LinearLayout", rootView.getName());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(10, rootView.getChildren().size());
- assertEquals(2, rootView.getUniqueChildren().size());
- for (int i = 0, n = rootView.getChildren().size(); i < n; i++) {
- CanvasViewInfo childView = rootView.getChildren().get(i);
- assertEquals("childView" + i, childView.getName());
- Object cookie = (i % 2) == 0 ? node1 : node2;
- assertSame(cookie, childView.getUiViewNode());
- List<CanvasViewInfo> nodeSiblings = childView.getNodeSiblings();
- assertEquals(5, nodeSiblings.size());
- }
- List<CanvasViewInfo> nodeSiblings = rootView.getChildren().get(0).getNodeSiblings();
- for (int j = 0; j < 5; j++) {
- assertEquals("childView" + (j * 2), nodeSiblings.get(j).getName());
- }
- nodeSiblings = rootView.getChildren().get(1).getNodeSiblings();
- for (int j = 0; j < 5; j++) {
- assertEquals("childView" + (j * 2 + 1), nodeSiblings.get(j).getName());
- }
- }
-
- public void testIncludeBounds() throws Exception {
- boolean layoutlib5 = true;
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("included", null, 0, 0, 100, 100);
-
- UiViewElementNode node1 = createNode(rootNode, "childNode1", false);
- UiViewElementNode node2 = createNode(rootNode, "childNode2", false);
- MergeCookie cookie1 = new MergeCookie(node1);
- MergeCookie cookie2 = new MergeCookie(node2);
-
- // Sets alternating merge cookies and checks whether the node sibling lists are
- // okay and merged correctly
-
- ArrayList<ViewInfo> children = new ArrayList<ViewInfo>();
- for (int i = 0; i < 10; i++) {
- Object cookie = (i % 2) == 0 ? cookie1 : cookie2;
- ViewInfo childView = new ViewInfo("childView" + i, cookie, 0, i * 20, 50,
- (i + 1) * 20);
- children.add(childView);
- }
- root.setChildren(children);
-
- Pair<CanvasViewInfo, List<Rectangle>> result = CanvasViewInfo.create(root, layoutlib5);
- CanvasViewInfo rootView = result.getFirst();
- List<Rectangle> bounds = result.getSecond();
- assertNotNull(rootView);
-
- assertEquals("included", rootView.getName());
- assertNull(rootView.getParent());
- assertNull(rootView.getUiViewNode());
- assertEquals(10, rootView.getChildren().size());
- assertEquals(2, rootView.getUniqueChildren().size());
- for (int i = 0, n = rootView.getChildren().size(); i < n; i++) {
- CanvasViewInfo childView = rootView.getChildren().get(i);
- assertEquals("childView" + i, childView.getName());
- Object cookie = (i % 2) == 0 ? node1 : node2;
- assertSame(cookie, childView.getUiViewNode());
- List<CanvasViewInfo> nodeSiblings = childView.getNodeSiblings();
- assertEquals(5, nodeSiblings.size());
- }
- List<CanvasViewInfo> nodeSiblings = rootView.getChildren().get(0).getNodeSiblings();
- for (int j = 0; j < 5; j++) {
- assertEquals("childView" + (j * 2), nodeSiblings.get(j).getName());
- }
- nodeSiblings = rootView.getChildren().get(1).getNodeSiblings();
- for (int j = 0; j < 5; j++) {
- assertEquals("childView" + (j * 2 + 1), nodeSiblings.get(j).getName());
- }
-
- // Only show the primary bounds as included
- assertEquals(2, bounds.size());
- assertEquals(new Rectangle(0, 0, 49, 19), bounds.get(0));
- assertEquals(new Rectangle(0, 20, 49, 19), bounds.get(1));
- }
-
- public void testIncludeBounds2() throws Exception {
- includeBounds2(false);
- }
-
- public void testIncludeBounds2LayoutLib5() throws Exception {
- includeBounds2(true);
- }
-
- public void includeBounds2(boolean layoutlib5) throws Exception {
-
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("included", null, 0, 0, 100, 100);
-
- UiViewElementNode node1 = createNode(rootNode, "childNode1", false);
- UiViewElementNode node2 = createNode(rootNode, "childNode2", false);
-
- ViewInfo childView1 = new ViewInfo("childView1", node1, 0, 20, 50, 40);
- ViewInfo childView2 = new ViewInfo("childView2", node2, 0, 40, 50, 60);
-
- root.setChildren(Arrays.asList(childView1, childView2));
-
- Pair<CanvasViewInfo, List<Rectangle>> result = CanvasViewInfo.create(root, layoutlib5);
- CanvasViewInfo rootView = result.getFirst();
- List<Rectangle> bounds = result.getSecond();
- assertNotNull(rootView);
-
- assertEquals("included", rootView.getName());
- assertNull(rootView.getParent());
- assertNull(rootView.getUiViewNode());
- assertEquals(2, rootView.getChildren().size());
- assertEquals(2, rootView.getUniqueChildren().size());
-
- Rectangle bounds1 = bounds.get(0);
- Rectangle bounds2 = bounds.get(1);
- assertEquals(new Rectangle(0, 20, 49, 19), bounds1);
- assertEquals(new Rectangle(0, 40, 49, 19), bounds2);
- }
-
- public void testCookieWorkaround() throws Exception {
- UiViewElementNode rootNode = createNode("android.widget.LinearLayout", true);
- ViewInfo root = new ViewInfo("included", null, 0, 0, 100, 100);
-
- UiViewElementNode node2 = createNode(rootNode, "childNode2", false);
- MergeCookie mergeCookie = new MergeCookie(root);
-
- ViewInfo childView1 = new ViewInfo("childView1", mergeCookie, 0, 20, 50, 40);
- ViewInfo childView2 = new ViewInfo("childView2", node2, 0, 40, 50, 60);
-
- root.setChildren(Arrays.asList(childView1, childView2));
-
- Pair<CanvasViewInfo, List<Rectangle>> result = CanvasViewInfo.create(root, true);
- CanvasViewInfo rootView = result.getFirst();
- List<Rectangle> bounds = result.getSecond();
- assertNotNull(rootView);
-
- assertEquals("included", rootView.getName());
- assertNull(rootView.getParent());
- assertNull(rootView.getUiViewNode());
- // childView1 should have been removed since it has the wrong merge cookie
- assertEquals(1, rootView.getChildren().size());
- assertEquals(1, rootView.getUniqueChildren().size());
-
- Rectangle bounds1 = bounds.get(0);
- assertEquals(new Rectangle(0, 40, 49, 19), bounds1);
- }
-
- public void testGestureOverlayView() throws Exception {
- boolean layoutlib5 = true;
-
- // Test rendering of included views on layoutlib 5+ (e.g. has <include> tag)
-
- UiViewElementNode rootNode = createNode("android.gesture.GestureOverlayView", true);
- UiViewElementNode childNode = createNode(rootNode, "android.widget.LinearLayout", false);
- UiViewElementNode grandChildNode = createNode(childNode, "android.widget.Button", false);
- ViewInfo root = new ViewInfo("GestureOverlayView", rootNode, 10, 10, 100, 100);
- ViewInfo child = new ViewInfo("LinearLayout", childNode, 0, 0, 50, 20);
- root.setChildren(Collections.singletonList(child));
- ViewInfo grandChild = new ViewInfo("Button", grandChildNode, 0, 20, 70, 25);
- child.setChildren(Collections.singletonList(grandChild));
- CanvasViewInfo rootView = CanvasViewInfo.create(root, layoutlib5).getFirst();
- assertNotNull(rootView);
- assertEquals("GestureOverlayView", rootView.getName());
-
- assertTrue(rootView.isRoot());
- assertNull(rootView.getParent());
- assertSame(rootNode, rootView.getUiViewNode());
- assertEquals(1, rootView.getChildren().size());
-
- CanvasViewInfo childView = rootView.getChildren().get(0);
- assertEquals("LinearLayout", childView.getName());
-
- // This should also be a root for the special case that the root is
- assertTrue(childView.isRoot());
-
- assertEquals(1, childView.getChildren().size());
- CanvasViewInfo grandChildView = childView.getChildren().get(0);
- assertEquals("Button", grandChildView.getName());
- assertFalse(grandChildView.isRoot());
- }
-
- public void testListView() throws Exception {
- // For ListViews we get AdapterItemReferences as cookies. Ensure that this
- // works properly.
- //
- // android.widget.FrameLayout [0,50,320,480] <FrameLayout>
- // android.widget.ListView [0,0,320,430] <ListView>
- // android.widget.LinearLayout [0,0,320,17] SessionParams$AdapterItemReference
- // android.widget.TextView [0,0,73,17]
- // android.widget.LinearLayout [0,18,320,35] SessionParams$AdapterItemReference
- // android.widget.TextView [0,0,73,17]
- // android.widget.LinearLayout [0,36,320,53] SessionParams$AdapterItemReference
- // android.widget.TextView [0,0,73,17]
- // ...
-
- UiViewElementNode rootNode = createNode("FrameLayout", true);
- UiViewElementNode childNode = createNode(rootNode, "ListView", false);
- /*UiViewElementNode grandChildNode =*/ createNode(childNode, "LinearLayout", false);
- /*UiViewElementNode greatGrandChildNode =*/ createNode(childNode, "TextView", false);
- DataBindingItem dataBindingItem = new DataBindingItem("foo");
-
- ViewInfo root = new ViewInfo("FrameLayout", rootNode, 0, 50, 320, 480);
- ViewInfo child = new ViewInfo("ListView", childNode, 0, 0, 320, 430);
- root.setChildren(Collections.singletonList(child));
- ViewInfo grandChild = new ViewInfo("LinearLayout", dataBindingItem, 0, 0, 320, 17);
- child.setChildren(Collections.singletonList(grandChild));
- ViewInfo greatGrandChild = new ViewInfo("Button", null, 0, 0, 73, 17);
- grandChild.setChildren(Collections.singletonList(greatGrandChild));
- CanvasViewInfo rootView = CanvasViewInfo.create(root, true /*layoutlib5*/).getFirst();
- assertNotNull(rootView);
-
- assertEquals("FrameLayout", rootView.getName());
- assertEquals(1, rootView.getChildren().size());
- assertSame(rootNode, rootView.getUiViewNode());
-
- CanvasViewInfo childView = rootView.getChildren().get(0);
- assertEquals("ListView", childView.getName());
- assertEquals(0, childView.getChildren().size());
- assertSame(childNode, childView.getUiViewNode());
- }
-
- /**
- * Dumps out the given {@link ViewInfo} hierarchy to standard out.
- * Useful during development.
- *
- * @param graphicalEditor the editor associated with this hierarchy
- * @param root the root of the {@link ViewInfo} hierarchy
- */
- public static void dump(GraphicalEditorPart graphicalEditor, ViewInfo root) {
- System.out.println("\n\nRendering:");
- boolean supportsEmbedding = graphicalEditor.renderingSupports(Capability.EMBEDDED_LAYOUT);
- System.out.println("Supports Embedded Layout=" + supportsEmbedding);
- System.out.println("Rendering context=" + graphicalEditor.getIncludedWithin());
- dump(root, 0);
- }
-
- /** Helper for {@link #dump(GraphicalEditorPart, ViewInfo)} */
- public static void dump(ViewInfo info, int depth) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < depth; i++) {
- sb.append(" ");
- }
- sb.append(info.getClassName());
- sb.append(" [");
- sb.append(info.getLeft());
- sb.append(",");
- sb.append(info.getTop());
- sb.append(",");
- sb.append(info.getRight());
- sb.append(",");
- sb.append(info.getBottom());
- sb.append("] ");
- Object cookie = info.getCookie();
- if (cookie instanceof UiViewElementNode) {
- sb.append(" ");
- UiViewElementNode node = (UiViewElementNode) cookie;
- sb.append("<");
- sb.append(node.getDescriptor().getXmlName());
- sb.append("> ");
- } else if (cookie != null) {
- sb.append(" cookie=" + cookie);
- }
-
- System.out.println(sb.toString());
-
- for (ViewInfo child : info.getChildren()) {
- dump(child, depth + 1);
- }
- }
-
- /** Helper for {@link #dump(GraphicalEditorPart, ViewInfo)} */
- public static void dump(CanvasViewInfo info, int depth) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < depth; i++) {
- sb.append(" ");
- }
- sb.append(info.getName());
- sb.append(" [");
- sb.append(info.getAbsRect());
- sb.append("], node=");
- sb.append(info.getUiViewNode());
-
- System.out.println(sb.toString());
-
- for (CanvasViewInfo child : info.getChildren()) {
- dump(child, depth + 1);
- }
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ControlPointTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ControlPointTest.java
deleted file mode 100644
index 366691e61..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ControlPointTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import org.eclipse.swt.events.MouseEvent;
-
-public class ControlPointTest extends PointTestCases {
- public void testCreateFromMouseEvent() throws Exception {
- MouseEvent mouseEvent = canvasMouseEvent(10, 20, 0);
-
- ControlPoint point = ControlPoint.create(mCanvas, mouseEvent);
- assertEquals(10, point.x);
- assertEquals(20, point.y);
- }
-
- public void testCreateFromCoordinates() throws Exception {
- ControlPoint point = ControlPoint.create(mCanvas, 10, 20);
- assertEquals(10, point.x);
- assertEquals(20, point.y);
- }
-
- public void testConvertToLayout() throws Exception {
- ControlPoint point = ControlPoint.create(new TestLayoutCanvas(), 10, 20);
- assertEquals(10, point.x);
- assertEquals(20, point.y);
-
- LayoutPoint layoutPoint = point.toLayout();
- assertNotNull(layoutPoint);
- assertEquals(40, layoutPoint.x);
- assertEquals(60, layoutPoint.y);
-
- // For sanity let's also convert back and verify
- ControlPoint controlPoint = layoutPoint.toControl();
- assertNotNull(controlPoint);
- assertNotSame(controlPoint, point);
- assertEquals(point, controlPoint);
- assertEquals(10, controlPoint.x);
- assertEquals(20, controlPoint.y);
- }
-
- public void testEquals() throws Exception {
- ControlPoint point1 = ControlPoint.create(mCanvas, 1, 1);
- ControlPoint point2 = ControlPoint.create(mCanvas, 1, 2);
- ControlPoint point3 = ControlPoint.create(mCanvas, 2, 1);
- ControlPoint point2b = ControlPoint.create(mCanvas, 1, 2);
-
- assertFalse(point2.equals(null));
-
- assertEquals(point2, point2);
- assertEquals(point2, point2b);
- assertEquals(point2.hashCode(), point2b.hashCode());
- assertNotSame(point2, point2b);
-
- assertFalse(point1.equals(point2));
- assertFalse(point1.equals(point3));
- assertFalse(point2.equals(point3));
- assertFalse(point1.equals(point2));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilitiesTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilitiesTest.java
deleted file mode 100644
index 6576bea3a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilitiesTest.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.gle2;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.TOOLS_URI;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import java.util.Arrays;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class DomUtilitiesTest extends TestCase {
-
- public void testIsEquivalent() throws Exception {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document1 = builder.newDocument();
- Document document2 = builder.newDocument();
- document1.appendChild(document1.createElement("root"));
- document2.appendChild(document2.createElement("root"));
-
- assertFalse(DomUtilities.isEquivalent(null, null));
- Element root1 = document1.getDocumentElement();
- assertFalse(DomUtilities.isEquivalent(null, root1));
- Element root2 = document2.getDocumentElement();
- assertFalse(DomUtilities.isEquivalent(root2, null));
- assertTrue(DomUtilities.isEquivalent(root1, root2));
-
- root1.appendChild(document1.createTextNode(" "));
- // Differences in text are NOT significant!
- assertTrue(DomUtilities.isEquivalent(root1, root2));
- root2.appendChild(document2.createTextNode(" "));
- assertTrue(DomUtilities.isEquivalent(root1, root2));
-
- Element foo1 = document1.createElement("foo");
- Element foo2 = document2.createElement("foo");
- root1.appendChild(foo1);
- assertFalse(DomUtilities.isEquivalent(root1, root2));
- root2.appendChild(foo2);
- assertTrue(DomUtilities.isEquivalent(root1, root2));
-
- root1.appendChild(document1.createElement("bar"));
- assertFalse(DomUtilities.isEquivalent(root1, root2));
- root2.appendChild(document2.createElement("bar"));
- assertTrue(DomUtilities.isEquivalent(root1, root2));
-
- // Add attributes in opposite order
- foo1.setAttribute("attribute1", "value1");
- foo1.setAttribute("attribute2", "value2");
- assertFalse(DomUtilities.isEquivalent(root1, root2));
- foo2.setAttribute("attribute2", "value2");
- foo2.setAttribute("attribute1", "valueWrong");
- assertFalse(DomUtilities.isEquivalent(root1, root2));
- foo2.setAttribute("attribute1", "value1");
- assertTrue(DomUtilities.isEquivalent(root1, root2));
- foo2.setAttributeNS(TOOLS_URI, "foo", "bar");
- assertTrue(DomUtilities.isEquivalent(root1, root2));
- foo2.setAttributeNS(ANDROID_URI, "foo", "bar");
- assertFalse(DomUtilities.isEquivalent(root1, root2));
-
- // TODO - test different tag names
- // TODO - test different name spaces!
- }
-
- public void testIsContiguous() throws Exception {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.newDocument();
- document.appendChild(document.createElement("root"));
- Element root = document.getDocumentElement();
- root.appendChild(document.createTextNode(" "));
- Element foo = document.createElement("foo");
- root.appendChild(foo);
- root.appendChild(document.createTextNode(" "));
- Element bar = document.createElement("bar");
- root.appendChild(bar);
- Element baz = document.createElement("baz");
- root.appendChild(baz);
-
- assertTrue(DomUtilities.isContiguous(Arrays.asList(foo)));
- assertTrue(DomUtilities.isContiguous(Arrays.asList(foo, bar)));
- assertTrue(DomUtilities.isContiguous(Arrays.asList(foo, bar, baz)));
- assertTrue(DomUtilities.isContiguous(Arrays.asList(foo, bar, baz)));
- assertTrue(DomUtilities.isContiguous(Arrays.asList(bar, baz, foo)));
- assertTrue(DomUtilities.isContiguous(Arrays.asList(baz, bar, foo)));
- assertTrue(DomUtilities.isContiguous(Arrays.asList(baz, foo, bar)));
-
- assertFalse(DomUtilities.isContiguous(Arrays.asList(foo, baz)));
- assertFalse(DomUtilities.isContiguous(Arrays.asList(root, baz)));
- }
-
- public void testGetCommonAncestor() throws Exception {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.newDocument();
-
- // A
- // / \
- // B C
- // / \
- // D E
-
- document.appendChild(document.createElement("A"));
- Element a = document.getDocumentElement();
- assertSame(a, DomUtilities.getCommonAncestor(a, a));
-
- Element b = document.createElement("B");
- a.appendChild(b);
- Element c = document.createElement("C");
- a.appendChild(c);
- Element d = document.createElement("D");
- c.appendChild(d);
- Element e = document.createElement("E");
- c.appendChild(e);
-
- assertSame(a, DomUtilities.getCommonAncestor(a, b));
- assertSame(a, DomUtilities.getCommonAncestor(b, a));
- assertSame(a, DomUtilities.getCommonAncestor(b, c));
- assertSame(a, DomUtilities.getCommonAncestor(b, d));
- assertSame(a, DomUtilities.getCommonAncestor(b, e));
- assertSame(a, DomUtilities.getCommonAncestor(a, e));
-
- assertSame(c, DomUtilities.getCommonAncestor(d, e));
- assertSame(c, DomUtilities.getCommonAncestor(c, e));
- assertSame(c, DomUtilities.getCommonAncestor(d, c));
- assertSame(c, DomUtilities.getCommonAncestor(c, c));
- }
-
- public void testGetDepth() throws Exception {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.newDocument();
-
- // A
- // / \
- // B C
- // / \
- // D E
-
- document.appendChild(document.createElement("A"));
- Element a = document.getDocumentElement();
- assertSame(a, DomUtilities.getCommonAncestor(a, a));
- Element b = document.createElement("B");
- a.appendChild(b);
- Element c = document.createElement("C");
- a.appendChild(c);
- Element d = document.createElement("D");
- c.appendChild(d);
- Element e = document.createElement("E");
- c.appendChild(e);
-
- assertEquals(0, DomUtilities.getDepth(document));
-
- assertEquals(1, DomUtilities.getDepth(a));
- assertEquals(2, DomUtilities.getDepth(b));
- assertEquals(2, DomUtilities.getDepth(c));
- assertEquals(3, DomUtilities.getDepth(d));
- assertEquals(3, DomUtilities.getDepth(e));
- }
-
- public void testHasChildren() throws Exception {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.newDocument();
- assertFalse(DomUtilities.hasElementChildren(document));
- document.appendChild(document.createElement("A"));
- Element a = document.getDocumentElement();
- assertFalse(DomUtilities.hasElementChildren(a));
- a.appendChild(document.createTextNode("foo"));
- assertFalse(DomUtilities.hasElementChildren(a));
- Element b = document.createElement("B");
- a.appendChild(b);
- assertTrue(DomUtilities.hasElementChildren(a));
- assertFalse(DomUtilities.hasElementChildren(b));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java
deleted file mode 100644
index d1c56c233..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import com.android.ide.common.api.Rect;
-
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class ImageUtilsTest extends TestCase {
- public void testCropBlank() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropBlank(image, null);
- assertNull(crop);
- }
-
- public void testCropBlankPre() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropBlank(image, new Rect(5, 5, 80, 80));
- assertNull(crop);
- }
-
- public void testCropNonblank() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, false));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropBlank(image, null);
- assertNotNull(crop);
- assertEquals(image.getWidth(), crop.getWidth());
- assertEquals(image.getHeight(), crop.getHeight());
- }
-
- public void testCropSomething() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(25, 25, 50, 50);
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropBlank(image, null);
- assertNotNull(crop);
- assertEquals(50, crop.getWidth());
- assertEquals(50, crop.getHeight());
- assertEquals(0xFF00FF00, crop.getRGB(0, 0));
- assertEquals(0xFF00FF00, crop.getRGB(49, 49));
- }
-
- public void testCropSomethingPre() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(25, 25, 50, 50);
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropBlank(image, new Rect(0, 0, 100, 100));
- assertNotNull(crop);
- assertEquals(50, crop.getWidth());
- assertEquals(50, crop.getHeight());
- assertEquals(0xFF00FF00, crop.getRGB(0, 0));
- assertEquals(0xFF00FF00, crop.getRGB(49, 49));
- }
-
- public void testCropSomethingPre2() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(25, 25, 50, 50);
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropBlank(image, new Rect(5, 5, 80, 80));
- assertNotNull(crop);
- assertEquals(50, crop.getWidth());
- assertEquals(50, crop.getHeight());
- assertEquals(0xFF00FF00, crop.getRGB(0, 0));
- assertEquals(0xFF00FF00, crop.getRGB(49, 49));
- }
-
- public void testCropColor() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropColor(image, 0xFF00FF00, null);
- assertNull(crop);
- }
-
- public void testCropNonColor() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropColor(image, 0xFFFF0000, null);
- assertNotNull(crop);
- assertEquals(image.getWidth(), crop.getWidth());
- assertEquals(image.getHeight(), crop.getHeight());
- }
-
- public void testCropColorSomething() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.setColor(new Color(0xFFFF0000, true));
- g.fillRect(25, 25, 50, 50);
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropColor(image, 0xFF00FF00, null);
- assertEquals(50, crop.getWidth());
- assertEquals(50, crop.getHeight());
- assertEquals(0xFFFF0000, crop.getRGB(0, 0));
- assertEquals(0xFFFF0000, crop.getRGB(49, 49));
- }
-
- public void testNothingTodo() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- BufferedImage crop = ImageUtils.cropColor(image, 0xFFFF0000, new Rect(40, 40, 0, 0));
- assertNull(crop);
- }
-
- public void testContainsDarkPixels() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.dispose();
-
- assertFalse(ImageUtils.containsDarkPixels(image));
-
- image.setRGB(50, 50, 0xFFFFFFFF);
- assertFalse(ImageUtils.containsDarkPixels(image));
- image.setRGB(50, 50, 0xFFAAAAAA);
- assertFalse(ImageUtils.containsDarkPixels(image));
- image.setRGB(50, 50, 0xFF00FF00);
- assertFalse(ImageUtils.containsDarkPixels(image));
- image.setRGB(50, 50, 0xFFFF8800);
- assertFalse(ImageUtils.containsDarkPixels(image));
- image.setRGB(50, 50, 0xFF333333);
- assertTrue(ImageUtils.containsDarkPixels(image));
-
- }
-
- public void testGetBoundingRectangle() {
- assertEquals(null, ImageUtils.getBoundingRectangle(Collections.<Rectangle> emptyList()));
-
- assertEquals(new Rectangle(1, 2, 3, 4), ImageUtils.getBoundingRectangle(Arrays
- .asList(new Rectangle(1, 2, 3, 4))));
- assertEquals(new Rectangle(1, 2, 3, 4), ImageUtils.getBoundingRectangle(Arrays
- .asList(new Rectangle(1, 2, 3, 4), new Rectangle(1, 2, 1, 1))));
- assertEquals(new Rectangle(5, 5, 25, 25), ImageUtils.getBoundingRectangle(Arrays.asList(
- new Rectangle(10, 10, 20, 20), new Rectangle(5, 5, 1, 1))));
- }
-
- /**
- * Paints a set of {@link Rectangle} object out of a rendered {@link BufferedImage}
- * such that the resulting image is transparent except for a minimum bounding
- * rectangle of the selected elements.
- *
- * @param image the source image
- * @param rectangles the set of rectangles to copy
- * @param boundingBox the bounding rectangle of the set of rectangles to copy, can be
- * computed by {@link ImageUtils#getBoundingRectangle}
- * @param scale a scale factor to apply to the result, e.g. 0.5 to shrink the
- * destination down 50%, 1.0 to leave it alone and 2.0 to zoom in by
- * doubling the image size
- * @return a rendered image, or null
- */
- public static BufferedImage drawRectangles(BufferedImage image,
- List<Rectangle> rectangles, Rectangle boundingBox, double scale) {
-
- // This code is not a test. When I implemented image cropping, I first implemented
- // it for BufferedImages (since it's easier; easy image painting, easy scaling,
- // easy transparency handling, etc). However, this meant that we would need to
- // convert the SWT images from the ImageOverlay to BufferedImages, crop and convert
- // back; not ideal, so I rewrote it in SWT (see SwtUtils). However, I
- // don't want to throw away the code in case we start keeping BufferedImages rather
- // than SWT images or need it for other purposes, but rather than place it in the
- // production codebase I'm leaving this utility here in the associated ImageUtils
- // test class. It was used like this:
- // @formatter:off
- //
- // BufferedImage wholeImage = SwtUtils.convertToAwt(image);
- // BufferedImage result = ImageUtils.cropSelection(wholeImage,
- // rectangles, boundingBox, scale);
- // e.image = SwtUtils.convertToSwt(image.getDevice(), result, true,
- // DRAG_TRANSPARENCY);
- //
- // @formatter:on
-
- if (boundingBox == null) {
- return null;
- }
-
- int destWidth = (int) (scale * boundingBox.width);
- int destHeight = (int) (scale * boundingBox.height);
- BufferedImage dest = new BufferedImage(destWidth, destHeight, image.getType());
-
- Graphics2D g = dest.createGraphics();
-
- for (Rectangle bounds : rectangles) {
- int dx1 = bounds.x - boundingBox.x;
- int dy1 = bounds.y - boundingBox.y;
- int dx2 = dx1 + bounds.width;
- int dy2 = dy1 + bounds.height;
-
- dx1 *= scale;
- dy1 *= scale;
- dx2 *= scale;
- dy2 *= scale;
-
- int sx1 = bounds.x;
- int sy1 = bounds.y;
- int sx2 = sx1 + bounds.width;
- int sy2 = sy1 + bounds.height;
-
- g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
- }
-
- g.dispose();
-
- return dest;
- }
-
- public void testSubImage() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.setColor(new Color(0xFFFF0000, true));
- g.fillRect(25, 25, 50, 50);
- g.dispose();
-
- BufferedImage sub = ImageUtils.subImage(image, 25, 25, 35, 45);
- assertEquals(10, sub.getWidth());
- assertEquals(20, sub.getHeight());
- assertEquals(0xFFFF0000, sub.getRGB(0, 0));
- assertEquals(0xFFFF0000, sub.getRGB(9, 9));
-
- sub = ImageUtils.subImage(image, 23, 23, 23 + 5, 23 + 5);
- assertEquals(5, sub.getWidth());
- assertEquals(5, sub.getHeight());
- assertEquals(0xFF00FF00, sub.getRGB(0, 0));
- assertEquals(0xFFFF0000, sub.getRGB(4, 4));
- }
-
- public void testGetColor() throws Exception {
- assertEquals(0xFF000000, ImageUtils.getColor("#000"));
- assertEquals(0xFF000000, ImageUtils.getColor("#000000"));
- assertEquals(0xABCDEF91, ImageUtils.getColor("#ABCDEF91"));
- }
-
- public void testGetBrightness() throws Exception {
- assertEquals(96, ImageUtils.getBrightness(0x456789));
- assertEquals(198, ImageUtils.getBrightness(0xABCDEF));
-
- assertEquals(0, ImageUtils.getBrightness(0x0));
- assertEquals(255, ImageUtils.getBrightness(0xFFFFFF));
- assertEquals(299*255/1000, ImageUtils.getBrightness(0xFF0000));
- assertEquals(587*255/1000, ImageUtils.getBrightness(0x00FF00));
- assertEquals(114*255/1000, ImageUtils.getBrightness(0x0000FF));
- }
-
- public void testColorConversion() throws Exception {
- assertEquals(0, ImageUtils.rgbToInt(ImageUtils.intToRgb(0), 0));
- assertEquals(0xFFFFFFFF, ImageUtils.rgbToInt(ImageUtils.intToRgb(0xFFFFFF), 0xFF));
- assertEquals(0x12345678, ImageUtils.rgbToInt(ImageUtils.intToRgb(0x345678), 0x12));
- }
-
- public void testScaleImage() throws Exception {
- BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
- Graphics g = image.getGraphics();
- g.setColor(new Color(0xFF00FF00, true));
- g.fillRect(0, 0, image.getWidth(), image.getHeight());
- g.setColor(new Color(0xFFFF0000, true));
- g.fillRect(25, 25, 50, 50);
- g.dispose();
-
- BufferedImage scaled = ImageUtils.scale(image, 0.5, 0.5);
- assertEquals(50, scaled.getWidth());
- assertEquals(50, scaled.getHeight());
- assertEquals(0xFF00FF00, scaled.getRGB(0, 0));
- assertEquals(0xFF00FF00, scaled.getRGB(49, 49));
- assertEquals(0xFFFF0000, scaled.getRGB(25, 25));
-
- scaled = ImageUtils.scale(image, 2.0, 2.0);
- assertEquals(200, scaled.getWidth());
- assertEquals(200, scaled.getHeight());
- assertEquals(0xFF00FF00, scaled.getRGB(0, 0));
- assertEquals(0xFF00FF00, scaled.getRGB(48, 48));
- assertEquals(0xFFFF0000, scaled.getRGB(100, 100));
- assertEquals(0xFF00FF00, scaled.getRGB(199, 199));
-
- scaled = ImageUtils.scale(image, 0.25, 0.25);
- assertEquals(25, scaled.getWidth());
- assertEquals(25, scaled.getHeight());
- assertEquals(0xFF00FF00, scaled.getRGB(0, 0));
- assertEquals(0xFF00FF00, scaled.getRGB(24, 24));
- assertEquals(0xFFFF0000, scaled.getRGB(13, 13));
-
- scaled = ImageUtils.scale(image, 0.25, 0.25, 75, 95);
- assertEquals(100, scaled.getWidth());
- assertEquals(120, scaled.getHeight());
- assertEquals(0xFF00FF00, scaled.getRGB(0, 0));
- assertEquals(0xFF00FF00, scaled.getRGB(24, 24));
- assertEquals(0xFFFF0000, scaled.getRGB(13, 13));
-
- }
-
- public void testCreateColoredImage() throws Exception {
- BufferedImage image = ImageUtils.createColoredImage(120, 110, new RGB(0xFE, 0xFD, 0xFC));
- assertEquals(120, image.getWidth());
- assertEquals(110, image.getHeight());
- assertEquals(0xFFFEFDFC, image.getRGB(0, 0));
- assertEquals(0xFFFEFDFC, image.getRGB(50, 50));
- assertEquals(0xFFFEFDFC, image.getRGB(119, 109));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java
deleted file mode 100644
index c86623cd6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class IncludeFinderTest extends TestCase {
- public void testEncodeDecode1() throws Exception {
- // Test ending with just a key
- String s = "bar,baz,foo";
- assertEquals(s, IncludeFinder.encodeMap(IncludeFinder.decodeMap(s)));
- }
-
- public void testDecode1() throws Exception {
- // Test ending with just a key
- String s = "foo";
- assertTrue(IncludeFinder.decodeMap(s).containsKey("foo"));
- assertEquals(0, IncludeFinder.decodeMap(s).get("foo").size());
- }
-
- public void testDecode2() throws Exception {
- // Test ending with just a key
- String s = "foo=>{bar,baz}";
- assertTrue(IncludeFinder.decodeMap(s).containsKey("foo"));
- assertEquals("[bar, baz]",
- IncludeFinder.decodeMap(s).get("foo").toString());
- }
-
- public void testNoBlanks() throws Exception {
- // Make sure we skip the },
- String s = "foo=>{bar,baz},bar";
- assertNull(IncludeFinder.decodeMap(s).get(""));
- }
-
- public void testEncodeDecode2() throws Exception {
- // Test ending with just a key
- String s = "bar,key1=>{value1,value2},key2=>{value3,value4}";
- assertEquals(s, IncludeFinder.encodeMap(IncludeFinder.decodeMap(s)));
- }
-
- public void testUpdates() throws Exception {
- IncludeFinder finder = IncludeFinder.create();
- assertEquals(null, finder.getIncludedBy("foo"));
-
- finder.setIncluded("bar", Arrays.<String>asList("foo", "baz"), false);
- finder.setIncluded("baz", Arrays.<String>asList("foo"), false);
- assertEquals(Arrays.asList("bar", "baz"), finder.getIncludedBy("foo"));
- finder.setIncluded("bar", Collections.<String>emptyList(), false);
- assertEquals(Arrays.asList("baz"), finder.getIncludedBy("foo"));
- finder.setIncluded("baz", Collections.<String>emptyList(), false);
- assertEquals(Collections.emptyList(), finder.getIncludedBy("foo"));
- }
-
- public void testFindIncludes() throws Exception {
- String xml =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
- " android:layout_width=\"match_parent\"\n" +
- " android:layout_height=\"match_parent\"\n" +
- " android:orientation=\"vertical\" >\n" +
- "\n" +
- " <RadioButton\n" +
- " android:id=\"@+id/radioButton1\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:text=\"RadioButton\" />\n" +
- "\n" +
- " <include\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " layout=\"@layout/layout3\" />\n" +
- "\n" +
- " <include\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " layout=\"@layout/layout4\" />\n" +
- "\n" +
- "</LinearLayout>";
- List<String> includes = IncludeFinder.findIncludes(xml);
- Collections.sort(includes);
- assertEquals(Arrays.asList("layout3", "layout4"), includes);
- }
-
- public void testFindFragments() throws Exception {
- String xml =
- "<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" +
- " <fragment\n" +
- " android:id=\"@+id/fragment1\"\n" +
- " android:name=\"android.app.ListFragment\"\n" +
- " android:layout_width=\"wrap_content\"\n" +
- " android:layout_height=\"wrap_content\"\n" +
- " android:layout_alignParentLeft=\"true\"\n" +
- " android:layout_alignParentTop=\"true\"\n" +
- " android:layout_marginLeft=\"58dp\"\n" +
- " android:layout_marginTop=\"74dp\"\n" +
- " tools:layout=\"@layout/myfragment\" />\n" +
- "\n" +
- "</RelativeLayout>";
- List<String> includes = IncludeFinder.findIncludes(xml);
- Collections.sort(includes);
- assertEquals(Arrays.asList("myfragment"), includes);
- }
-
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeOverlayTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeOverlayTest.java
deleted file mode 100644
index a96b1a387..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeOverlayTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import org.eclipse.swt.graphics.Rectangle;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-public class IncludeOverlayTest extends TestCase {
-
- public void testSubtractRectangles() throws Exception {
- checkSubtract(new Rectangle(0, 0, 100, 80), Collections.<Rectangle> emptyList());
-
- checkSubtract(new Rectangle(0, 0, 100, 80), Arrays.asList(new Rectangle(50, 50, 20, 20)));
-
- checkSubtract(new Rectangle(0, 0, 100, 80), Arrays.asList(new Rectangle(50, 50, 20, 20),
- new Rectangle(90, 90, 10, 10)));
-
- checkSubtract(new Rectangle(0, 0, 100, 80), Arrays.asList(new Rectangle(50, 50, 20, 20),
- new Rectangle(90, 90, 10, 10), new Rectangle(0, 0, 10, 10)));
-
- }
-
- private void checkSubtract(Rectangle rectangle, List<Rectangle> holes) {
- Collection<Rectangle> result = IncludeOverlay.subtractRectangles(rectangle, holes);
-
- // Do some Monte Carlo testing - pick random coordinates and check that if they
- // are within one of the holes then they are not in the result list and vice versa
- Random random = new Random(42L);
- for (int i = 0; i < 1000; i++) {
- int x = random.nextInt(rectangle.width);
- int y = random.nextInt(rectangle.height);
-
- boolean inHole = false;
- for (Rectangle hole : holes) {
- if (hole.contains(x, y)) {
- inHole = true;
- }
- }
-
- boolean inResult = false;
- for (Rectangle r : result) {
- if (r.contains(x, y)) {
- inResult = true;
- break;
- }
- }
-
- if (inHole == inResult) {
- fail("Wrong result at (" + x + "," + y + ") for rectangle=" + rectangle
- + " and holes=" + holes + " where inHole=inResult="
- + inResult);
- }
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutPointTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutPointTest.java
deleted file mode 100644
index c053de854..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutPointTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-public class LayoutPointTest extends PointTestCases {
- public void testCreateFromCoordinates() throws Exception {
- LayoutPoint point = LayoutPoint.create(mCanvas, 10, 20);
- assertEquals(10, point.x);
- assertEquals(20, point.y);
- }
-
- public void testEquals() throws Exception {
- LayoutPoint point1 = LayoutPoint.create(mCanvas, 1, 1);
- LayoutPoint point2 = LayoutPoint.create(mCanvas, 1, 2);
- LayoutPoint point3 = LayoutPoint.create(mCanvas, 2, 1);
- LayoutPoint point2b = LayoutPoint.create(mCanvas, 1, 2);
-
- assertFalse(point2.equals(null));
-
- assertEquals(point2, point2);
- assertEquals(point2, point2b);
- assertEquals(point2.hashCode(), point2b.hashCode());
- assertNotSame(point2, point2b);
-
- assertFalse(point1.equals(point2));
- assertFalse(point1.equals(point3));
- assertFalse(point2.equals(point3));
- assertFalse(point1.equals(point2));
- }
-
- public void testConvertToControl() throws Exception {
- LayoutPoint point = LayoutPoint.create(new TestLayoutCanvas(), 10, 20);
- assertEquals(10, point.x);
- assertEquals(20, point.y);
-
- ControlPoint controlPoint = point.toControl();
- assertNotNull(controlPoint);
- assertEquals(-5, controlPoint.x);
- assertEquals(0, controlPoint.y);
-
- // For sanity let's also convert back and verify
- LayoutPoint layoutPoint = controlPoint.toLayout();
- assertNotNull(layoutPoint);
- assertNotSame(layoutPoint, point);
- assertEquals(point, layoutPoint);
- assertEquals(10, layoutPoint.x);
- assertEquals(20, layoutPoint.y);
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PointTestCases.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PointTestCases.java
deleted file mode 100644
index 91d0e133f..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PointTestCases.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-
-import junit.framework.TestCase;
-
-/**
- * Common utilities for the point tests {@link LayoutPointTest} and
- * {@link ControlPointTest}
- */
-public class PointTestCases extends TestCase {
- LayoutCanvas mCanvas = new TestLayoutCanvas();
-
- protected MouseEvent canvasMouseEvent(int x, int y, int stateMask) {
- Event event = new Event();
- event.x = x;
- event.y = y;
- event.stateMask = stateMask;
- event.widget = mCanvas;
- MouseEvent mouseEvent = new MouseEvent(event);
- return mouseEvent;
- }
-
- /** Mock implementation of LayoutCanvas */
- protected static class TestLayoutCanvas extends LayoutCanvas {
- float mScaleX;
-
- float mScaleY;
-
- float mTranslateX;
-
- float mTranslateY;
-
- public TestLayoutCanvas(float scaleX, float scaleY, float translateX, float translateY) {
- super(null, null, new Shell(), 0);
-
- this.mScaleX = scaleX;
- this.mScaleY = scaleY;
- this.mTranslateX = translateX;
- this.mTranslateY = translateY;
- }
-
- public TestLayoutCanvas() {
- this(2.0f, 2.0f, 20.0f, 20.0f);
- }
-
- @Override
- CanvasTransform getHorizontalTransform() {
- ScrollBar scrollBar = new List(this, SWT.V_SCROLL|SWT.H_SCROLL).getHorizontalBar();
- return new TestCanvasTransform(scrollBar, mScaleX, mTranslateX);
- }
-
- @Override
- CanvasTransform getVerticalTransform() {
- ScrollBar scrollBar = new List(this, SWT.V_SCROLL|SWT.H_SCROLL).getVerticalBar();
- return new TestCanvasTransform(scrollBar, mScaleY, mTranslateY);
- }
- }
-
- static class TestCanvasTransform extends CanvasTransform {
- float mScale;
-
- float mTranslate;
-
- public TestCanvasTransform(ScrollBar scrollBar, float scale, float translate) {
- super(null, scrollBar);
- this.mScale = scale;
- this.mTranslate = translate;
- }
-
- @Override
- public int translate(int value) {
- return (int) ((value - mTranslate) / mScale);
- }
-
- @Override
- public int inverseTranslate(int value) {
- return (int) (value * mScale + mTranslate);
- }
- }
-
- public void testDummy() {
- // To avoid JUnit warning that this class contains no tests, even though
- // this is an abstract class and JUnit shouldn't try
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLoggerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLoggerTest.java
deleted file mode 100644
index c28d9a966..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderLoggerTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import junit.framework.TestCase;
-
-public class RenderLoggerTest extends TestCase {
- public void testLogger1() throws Exception {
- RenderLogger l = new RenderLogger("foo", null);
- assertFalse(l.hasProblems());
- }
-
- public void testLogger2() throws Exception {
- RenderLogger l = new RenderLogger("foo", null);
- assertFalse(l.hasProblems());
- l.fidelityWarning(null, "No perspective Transforms", null, null);
- l.fidelityWarning(null, "No GPS", null, null);
- assertTrue(l.hasProblems());
- assertEquals("The graphics preview in the layout editor may not be accurate:\n"
- + "* No perspective Transforms\n" + "* No GPS\n", l.getProblems(true));
- assertFalse(l.seenTag("foo"));
- assertFalse(l.seenTag(null));
- }
-
- public void testLogger3() throws Exception {
- RenderLogger l = new RenderLogger("foo", null);
- assertFalse(l.hasProblems());
- l.error("timeout", "Sample Error", new RuntimeException(), null);
- l.warning("slow", "Sample warning", null);
- assertTrue(l.hasProblems());
- assertEquals("Sample Error\n" + "Sample warning\n"
- + "Exception details are logged in Window > Show View > Error Log",
- l.getProblems(true));
- assertFalse(l.seenTag("foo"));
- assertTrue(l.seenTag("timeout"));
- assertTrue(l.seenTag("slow"));
- assertFalse(l.seenTagPrefix("foo"));
- assertTrue(l.seenTagPrefix("timeout"));
- assertTrue(l.seenTagPrefix("slow"));
- assertTrue(l.seenTagPrefix("time"));
- assertFalse(l.seenTagPrefix("timeouts"));
- }
-
- public void testLoggerSuppressWarnings() throws Exception {
- RenderLogger l = new RenderLogger("foo", null);
- assertFalse(l.hasProblems());
- RenderLogger.ignoreFidelityWarning("No perspective Transforms");
- l.fidelityWarning(null, "No perspective Transforms", null, null);
- l.fidelityWarning(null, "No GPS", null, null);
- assertTrue(l.hasProblems());
- assertEquals("The graphics preview in the layout editor may not be accurate:\n"
- + "* No GPS\n", l.getProblems(true));
- assertEquals("", l.getProblems(false));
- assertFalse(l.seenTag("foo"));
- assertFalse(l.seenTag(null));
-
- l = new RenderLogger("foo", null);
- assertFalse(l.hasProblems());
- RenderLogger.ignoreFidelityWarning("No perspective Transforms");
- RenderLogger.ignoreFidelityWarning("No GPS");
- l.fidelityWarning(null, "No perspective Transforms", null, null);
- l.fidelityWarning(null, "No GPS", null, null);
- assertFalse(l.hasProblems());
- assertEquals("", l.getProblems(true));
- assertFalse(l.seenTag("foo"));
- assertFalse(l.seenTag(null));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManagerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManagerTest.java
deleted file mode 100644
index b29f9f3c5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManagerTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.gle2;
-
-import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
-
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-public class SelectionManagerTest extends TestCase {
- private SelectionManager createManager() {
- LayoutCanvas canvas = new LayoutCanvas(null, null, new Shell(), 0);
- return new SelectionManager(canvas);
- }
-
- public void testEmpty() {
- SelectionManager manager = createManager();
-
- assertNotNull(manager.getSelections());
- assertEquals(0, manager.getSelections().size());
- assertFalse(manager.hasMultiSelection());
- assertTrue(manager.isEmpty());
- }
-
- public void testBasic() {
- SelectionManager manager = createManager();
- assertTrue(manager.isEmpty());
-
- UiViewElementNode rootNode = CanvasViewInfoTest.createNode("android.widget.LinearLayout",
- true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = CanvasViewInfoTest.createNode(rootNode,
- "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("Button1", child1Node, 0, 0, 50, 20);
- UiViewElementNode child2Node = CanvasViewInfoTest.createNode(rootNode,
- "android.widget.Button", false);
- ViewInfo child2 = new ViewInfo("Button2", child2Node, 0, 20, 70, 25);
- root.setChildren(Arrays.asList(child1, child2));
- CanvasViewInfo rootView = CanvasViewInfo.create(root, true /* layoutlib5 */).getFirst();
- assertNotNull(rootView);
-
- manager.selectMultiple(Arrays.asList(rootView, rootView.getChildren().get(0), rootView
- .getChildren().get(1)));
- assertEquals(3, manager.getSelections().size());
- assertFalse(manager.isEmpty());
- assertTrue(manager.hasMultiSelection());
-
- // Expect read-only result; ensure that's the case
- try {
- manager.getSelections().remove(0);
- fail("Result should be read only collection");
- } catch (Exception e) {
- ; //ok, what we expected
- }
-
- manager.selectNone();
- assertEquals(0, manager.getSelections().size());
- assertTrue(manager.isEmpty());
-
- manager.selectSingle(rootView);
- assertEquals(1, manager.getSelections().size());
- assertFalse(manager.isEmpty());
- assertSame(rootView, manager.getSelections().get(0).getViewInfo());
-
- manager.selectMultiple(Arrays.asList(rootView, rootView.getChildren().get(0), rootView
- .getChildren().get(1)));
- assertEquals(3, manager.getSelections().size());
-
- manager.deselect(rootView.getChildren().get(0));
- assertEquals(2, manager.getSelections().size());
- manager.deselect(rootView);
- assertEquals(1, manager.getSelections().size());
- assertSame(rootView.getChildren().get(1), manager.getSelections().get(0).getViewInfo());
- }
-
- public void testSelectParent() {
- SelectionManager manager = createManager();
- assertTrue(manager.isEmpty());
-
- UiViewElementNode rootNode = CanvasViewInfoTest.createNode("android.widget.LinearLayout",
- true);
- ViewInfo root = new ViewInfo("LinearLayout", rootNode, 10, 10, 100, 100);
- UiViewElementNode child1Node = CanvasViewInfoTest.createNode(rootNode,
- "android.widget.Button", false);
- ViewInfo child1 = new ViewInfo("Button1", child1Node, 0, 0, 50, 20);
- UiViewElementNode child2Node = CanvasViewInfoTest.createNode(rootNode,
- "android.widget.Button", false);
- ViewInfo child2 = new ViewInfo("Button2", child2Node, 0, 20, 70, 25);
- root.setChildren(Arrays.asList(child1, child2));
- CanvasViewInfo rootView = CanvasViewInfo.create(root, true /* layoutlib5 */).getFirst();
- assertNotNull(rootView);
-
- manager.selectMultiple(Arrays.asList(rootView.getChildren().get(0)));
- assertEquals(1, manager.getSelections().size());
- assertFalse(manager.isEmpty());
- assertSame(rootView.getChildren().get(0), manager.getSelections().get(0).getViewInfo());
-
- manager.selectParent();
- assertEquals(1, manager.getSelections().size());
- assertFalse(manager.isEmpty());
- assertSame(rootView, manager.getSelections().get(0).getViewInfo());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttributeTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttributeTest.java
deleted file mode 100755
index f4f8eb81a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleAttributeTest.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import com.android.SdkConstants;
-
-import junit.framework.TestCase;
-
-public class SimpleAttributeTest extends TestCase {
-
- private SimpleAttribute a;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- a = new SimpleAttribute(SdkConstants.NS_RESOURCES, "name", "value = with space ");
- }
-
- public final void testSimpleAttribute() {
- assertEquals(SdkConstants.NS_RESOURCES, a.getUri());
- assertEquals("name", a.getName());
- assertEquals("value = with space ", a.getValue());
- }
-
- public final void testGetUri() {
- assertEquals(SdkConstants.NS_RESOURCES, a.getUri());
- }
-
- public final void testGetName() {
- assertEquals("name", a.getName());
- }
-
- public final void testGetValue() {
- assertEquals("value = with space ", a.getValue());
- }
-
- public final void testToString() {
- assertEquals(
- "@name:" + SdkConstants.NS_RESOURCES + "=value = with space \n",
- a.toString());
- }
-
- public final void testParseString() {
- String s = "@name:" + SdkConstants.NS_RESOURCES + "=value = with space \n";
- SimpleAttribute b = SimpleAttribute.parseString(s);
- assertEquals(a, b);
- }
-
- public final void testEqualsObject() {
- assertFalse(a.equals(null));
- assertFalse(a.equals(new Object()));
-
- // wrong name
- assertFalse(a.equals(new SimpleAttribute(SdkConstants.NS_RESOURCES,
- "wrong name",
- "value = with space ")));
- // wrong value
- assertFalse(a.equals(new SimpleAttribute(SdkConstants.NS_RESOURCES,
- "name",
- "value")));
- // wrong uri
- assertFalse(a.equals(new SimpleAttribute("uri", "name", "value = with space ")));
- // all fields wrong
- assertFalse(a.equals(new SimpleAttribute("uri", "wrong name", "value")));
-
- assertTrue(a.equals(new SimpleAttribute(SdkConstants.NS_RESOURCES,
- "name",
- "value = with space ")));
- }
-
- public final void testHashCode() {
-
- int ah = a.hashCode();
-
- assertFalse(ah == new Object().hashCode());
-
- // wrong name
- assertFalse(ah == new SimpleAttribute(SdkConstants.NS_RESOURCES,
- "wrong name",
- "value = with space ").hashCode());
- // wrong value
- assertFalse(ah == new SimpleAttribute(SdkConstants.NS_RESOURCES,
- "name",
- "value").hashCode());
- // wrong uri
- assertFalse(ah == new SimpleAttribute("uri", "name", "value = with space ").hashCode());
- // all fields wrong
- assertFalse(ah == new SimpleAttribute("uri", "wrong name", "value").hashCode());
-
- assertEquals(ah, new SimpleAttribute(SdkConstants.NS_RESOURCES,
- "name",
- "value = with space ").hashCode());
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElementTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElementTest.java
deleted file mode 100755
index 091aa378c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SimpleElementTest.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import com.android.ide.common.api.Rect;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-public class SimpleElementTest extends TestCase {
-
- private SimpleElement e;
-
- /**
- * Helper method to compare arrays' *content* is equal (instead of object identity).
- * Also produces a suitable output to understand mismatch, if any.
- * <p/>
- * Pre-requisite: The arrays' elements must properly implement {@link Object#equals(Object)}
- * and a sensible {@link Object#toString()}.
- */
- private static void assertArrayEquals(Object[] expected, Object[] actual) {
- if (!Arrays.equals(expected, actual)) {
- // In case of failure, transform the arguments into strings and let
- // assertEquals(string) handle it as it can produce a nice diff of the string.
- String strExpected = expected == null ? "(null)" : Arrays.toString(expected);
- String strActual = actual == null ? "(null)" : Arrays.toString(actual);
-
- if (strExpected.equals(strActual)) {
- fail(String.format("Array not equal:\n Expected[%d]=%s\n Actual[%d]=%s",
- expected == null ? 0 : expected.length,
- strExpected,
- actual == null ? 0 : actual.length,
- strActual));
- } else {
- assertEquals(strExpected, strActual);
- }
- }
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- e = new SimpleElement("android.view.LinearLayout", // fqcn
- "android.view.FrameLayout", // parentFqcn
- new Rect(10, 5, 60, 40), // bounds
- new Rect(0, 0, 320, 480)); // parentBounds
- }
-
- public final void testGetFqcn() {
- assertEquals("android.view.LinearLayout", e.getFqcn());
- }
-
- public final void testGetParentFqcn() {
- assertEquals("android.view.FrameLayout", e.getParentFqcn());
- }
-
- public final void testGetBounds() {
- assertEquals(new Rect(10, 5, 60, 40), e.getBounds());
- }
-
- public final void testGetParentBounds() {
- assertEquals(new Rect(0, 0, 320, 480), e.getParentBounds());
- }
-
- public final void testToString() {
- assertEquals("{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "}\n",
- e.toString());
-
- e.addAttribute(new SimpleAttribute("uri", "name", "value"));
- e.addAttribute(new SimpleAttribute("my-uri", "second-name", "my = value "));
-
- assertEquals("{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "@name:uri=value\n" +
- "@second-name:my-uri=my = value \n" +
- "}\n",
- e.toString());
-
- SimpleElement e2 = new SimpleElement("android.view.Button",
- "android.view.LinearLayout",
- new Rect(10, 20, 30, 40),
- new Rect(0, 0, 320, 480));
- e2.addAttribute(new SimpleAttribute("uri1", "name1", "value1"));
- SimpleElement e3 = new SimpleElement("android.view.CheckBox",
- "android.view.LinearLayout",
- new Rect(-1, -2, -3, -4), // invalid rect is ignored
- new Rect(-1, -2, -3, -4)); // invalid rectis ignored
- e3.addAttribute(new SimpleAttribute("uri2", "name2", "value2"));
- e3.addAttribute(new SimpleAttribute("uri3", "name3", "value3"));
- e.addInnerElement(e2);
- e.addInnerElement(e3);
-
- assertEquals("{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "@name:uri=value\n" +
- "@second-name:my-uri=my = value \n" +
- "{V=3,N=android.view.Button,P=android.view.LinearLayout,R=10 20 30 40,Q=0 0 320 480\n" +
- "@name1:uri1=value1\n" +
- "}\n" +
- "{V=3,N=android.view.CheckBox,P=android.view.LinearLayout\n" +
- "@name2:uri2=value2\n" +
- "@name3:uri3=value3\n" +
- "}\n" +
- "}\n",
- e.toString());
- }
-
- public final void testParseString() {
- assertArrayEquals(
- new SimpleElement[] { new SimpleElement("android.view.LinearLayout",
- null, null, null) },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout\n" +
- "}\n"));
-
- assertArrayEquals(
- new SimpleElement[] { new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- null, null) },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout\n" +
- "}\n"));
-
- assertArrayEquals(
- new SimpleElement[] { new SimpleElement("android.view.LinearLayout",
- null,
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480)) },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "}\n"));
-
-
- assertArrayEquals(
- new SimpleElement[] { e },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "}\n"));
-
-
- e.addAttribute(new SimpleAttribute("uri", "name", "value"));
- e.addAttribute(new SimpleAttribute("my-uri", "second-name", "my = value "));
-
- assertArrayEquals(
- new SimpleElement[] { e },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "@name:uri=value\n" +
- "@second-name:my-uri=my = value \n" +
- "}\n"));
-
-
- SimpleElement e2 = new SimpleElement("android.view.Button",
- "android.view.LinearLayout",
- new Rect(10, 20, 30, 40),
- new Rect(0, 0, 320, 480));
- e2.addAttribute(new SimpleAttribute("uri1", "name1", "value1"));
- SimpleElement e3 = new SimpleElement("android.view.CheckBox",
- "android.view.LinearLayout",
- new Rect(-1, -2, -3, -4),
- new Rect(-1, -2, -3, -4));
- e3.addAttribute(new SimpleAttribute("uri2", "name2", "value2"));
- e3.addAttribute(new SimpleAttribute("uri3", "name3", "value3"));
- e.addInnerElement(e2);
- e.addInnerElement(e3);
-
- assertArrayEquals(
- new SimpleElement[] { e },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "@name:uri=value\n" +
- "@second-name:my-uri=my = value \n" +
- "{V=3,N=android.view.Button,P=android.view.LinearLayout,R=10 20 30 40,Q=0 0 320 480\n" +
- "@name1:uri1=value1\n" +
- "}\n" +
- "{V=3,N=android.view.CheckBox,P=android.view.LinearLayout,R=-1 -2 -3 -4,Q=-1 -2 -3 -4\n" +
- "@name2:uri2=value2\n" +
- "@name3:uri3=value3\n" +
- "}\n" +
- "}\n"));
-
- // Parse string can also parse an array of elements
- assertArrayEquals(
- new SimpleElement[] { e, e2, e3 },
- SimpleElement.parseString(
- "{V=3,N=android.view.LinearLayout,P=android.view.FrameLayout,R=10 5 60 40,Q=0 0 320 480\n" +
- "@name:uri=value\n" +
- "@second-name:my-uri=my = value \n" +
- "{V=3,N=android.view.Button,P=android.view.LinearLayout,R=10 20 30 40,Q=0 0 320 480\n" +
- "@name1:uri1=value1\n" +
- "}\n" +
- "{V=3,N=android.view.CheckBox,P=android.view.LinearLayout,R=-1 -2 -3 -4\n" +
- "@name2:uri2=value2\n" +
- "@name3:uri3=value3\n" +
- "}\n" +
- "}\n" +
- "{V=3,N=android.view.Button,P=android.view.LinearLayout,R=10 20 30 40,Q=0 0 320 480\n" +
- "@name1:uri1=value1\n" +
- "}\n" +
- "{V=3,N=android.view.CheckBox,P=android.view.LinearLayout,R=-1 -2 -3 -4,Q=-1 -2 -3 -4\n" +
- "@name2:uri2=value2\n" +
- "@name3:uri3=value3\n" +
- "}\n"));
-
- }
-
- public final void testAddGetAttribute() {
- assertNotNull(e.getAttributes());
- assertArrayEquals(
- new SimpleAttribute[] {},
- e.getAttributes());
-
- e.addAttribute(new SimpleAttribute("uri", "name", "value"));
- assertArrayEquals(
- new SimpleAttribute[] { new SimpleAttribute("uri", "name", "value") },
- e.getAttributes());
-
- e.addAttribute(new SimpleAttribute("my-uri", "second-name", "value"));
- assertArrayEquals(
- new SimpleAttribute[] { new SimpleAttribute("uri", "name", "value"),
- new SimpleAttribute("my-uri", "second-name", "value") },
- e.getAttributes());
-
- assertNull(e.getAttribute("unknown uri", "name"));
- assertNull(e.getAttribute("uri", "unknown name"));
- assertEquals(new SimpleAttribute("uri", "name", "value"),
- e.getAttribute("uri", "name"));
- assertEquals(new SimpleAttribute("my-uri", "second-name", "value"),
- e.getAttribute("my-uri", "second-name"));
- }
-
- public final void testAddGetInnerElements() {
- assertNotNull(e.getInnerElements());
- assertArrayEquals(
- new SimpleElement[] {},
- e.getInnerElements());
-
- e.addInnerElement(new SimpleElement("android.view.Button", null, null, null));
- assertArrayEquals(
- new SimpleElement[] { new SimpleElement("android.view.Button", null, null, null) },
- e.getInnerElements());
-
- e.addInnerElement(new SimpleElement("android.view.CheckBox", null, null, null));
- assertArrayEquals(
- new SimpleElement[] { new SimpleElement("android.view.Button", null, null, null),
- new SimpleElement("android.view.CheckBox", null, null, null) },
- e.getInnerElements());
- }
-
- public final void testEqualsObject() {
- assertFalse(e.equals(null));
- assertFalse(e.equals(new Object()));
-
- assertNotSame(new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480)),
- e);
- assertEquals(new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480)),
- e);
- assertTrue(e.equals(new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480))));
-
- // not the same FQCN
- assertFalse(e.equals(new SimpleElement("android.view.Button",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480))));
-
- // not the same parent
- assertFalse(e.equals(new SimpleElement("android.view.LinearLayout",
- "android.view.LinearLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480))));
-
- // not the same bounds
- assertFalse(e.equals(new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 25, 30, 40),
- new Rect(0, 0, 320, 480))));
-
- // not the same parent bounds
- assertFalse(e.equals(new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(10, 100, 160, 240))));
- }
-
- public final void testHashCode() {
- int he = e.hashCode();
-
- assertEquals(he, new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480)).hashCode());
-
-
- // not the same FQCN
- assertFalse(he == new SimpleElement("android.view.Button",
- "android.view.FrameLayout",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480)).hashCode());
-
- // not the same parent
- assertFalse(he == new SimpleElement("android.view.LinearLayout",
- "android.view.Button",
- new Rect(10, 5, 60, 40),
- new Rect(0, 0, 320, 480)).hashCode());
-
- // not the same bounds
- assertFalse(he == new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 25, 30, 40),
- new Rect(0, 0, 320, 480)).hashCode());
-
- // not the same parent bounds
- assertFalse(he == new SimpleElement("android.view.LinearLayout",
- "android.view.FrameLayout",
- new Rect(10, 25, 30, 40),
- new Rect(10, 100, 160, 240)).hashCode());
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SwtUtilsTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SwtUtilsTest.java
deleted file mode 100644
index de7999c24..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SwtUtilsTest.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gle2;
-
-import com.android.ide.common.api.Rect;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.image.BufferedImage;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class SwtUtilsTest extends TestCase {
-
- public void testImageConvertNoAlpha() throws Exception {
- // Note: We need an TYPE_INT_ARGB SWT image here (instead of TYPE_INT_ARGB_PRE) to
- // prevent the alpha from being pre-multiplied into the RGB when drawing the image.
- BufferedImage inImage = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
- Graphics g = inImage.getGraphics();
- g.setColor(new Color(0xAA112233, true));
- g.fillRect(0, 0, inImage.getWidth(), inImage.getHeight());
- g.dispose();
-
- Shell shell = new Shell();
- Display display = shell.getDisplay();
-
- // Convert the RGB image, effectively discarding the alpha channel entirely.
- Image outImage = SwtUtils.convertToSwt(display, inImage, false, -1);
- assertNotNull(outImage);
-
- ImageData outData = outImage.getImageData();
- assertEquals(inImage.getWidth(), outData.width);
- assertEquals(inImage.getHeight(), outData.height);
- assertNull(outData.alphaData);
- assertEquals(SWT.TRANSPARENCY_NONE, outData.getTransparencyType());
-
- PaletteData inPalette = SwtUtils.getAwtPaletteData(inImage.getType());
- PaletteData outPalette = outData.palette;
-
- for (int y = 0; y < outData.height; y++) {
- for (int x = 0; x < outData.width; x++) {
- // Note: we can't compare pixel directly as integers since convertToSwt() might
- // have changed the RGBA ordering depending on the platform (e.g. it will on
- // Windows.)
- RGB expected = inPalette.getRGB( inImage.getRGB( x, y));
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
- }
- }
-
- // Convert back to AWT and compare with original AWT image
- BufferedImage awtImage = SwtUtils.convertToAwt(outImage);
- assertNotNull(awtImage);
-
- // Both image have the same RGBA ordering
- assertEquals(BufferedImage.TYPE_INT_ARGB, inImage.getType());
- assertEquals(BufferedImage.TYPE_INT_ARGB, awtImage.getType());
-
- int awtAlphaMask = 0xFF000000;
-
- for (int y = 0; y < outData.height; y++) {
- for (int x = 0; x < outData.width; x++) {
- // Note: we can compare pixels as integers since we just
- // asserted both images have the same color image type except
- // for the content of the alpha channel.
- int actual = awtImage.getRGB(x, y);
- assertEquals(awtAlphaMask, actual & awtAlphaMask);
- assertEquals(awtAlphaMask | inImage.getRGB(x, y), awtImage.getRGB(x, y));
- }
- }
- }
-
- public void testImageConvertGlobalAlpha() throws Exception {
- BufferedImage inImage = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
- Graphics g = inImage.getGraphics();
- g.setColor(new Color(0xAA112233, true));
- g.fillRect(0, 0, inImage.getWidth(), inImage.getHeight());
- g.dispose();
-
- Shell shell = new Shell();
- Display display = shell.getDisplay();
-
- Image outImage = SwtUtils.convertToSwt(display, inImage, false, 128);
- assertNotNull(outImage);
-
- ImageData outData = outImage.getImageData();
- assertEquals(inImage.getWidth(), outData.width);
- assertEquals(inImage.getHeight(), outData.height);
- assertEquals(128, outData.alpha);
- assertEquals(SWT.TRANSPARENCY_NONE, outData.getTransparencyType());
- assertNull(outData.alphaData);
-
- PaletteData inPalette = SwtUtils.getAwtPaletteData(inImage.getType());
- PaletteData outPalette = outData.palette;
-
- for (int y = 0; y < outData.height; y++) {
- for (int x = 0; x < outData.width; x++) {
-
- RGB expected = inPalette.getRGB( inImage.getRGB( x, y));
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
- }
- }
- }
-
- public void testImageConvertAlpha() throws Exception {
- BufferedImage inImage = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
- Graphics g = inImage.getGraphics();
- g.setColor(new Color(0xAA112233, true));
- g.fillRect(0, 0, inImage.getWidth(), inImage.getHeight());
- g.dispose();
-
- Shell shell = new Shell();
- Display display = shell.getDisplay();
-
- Image outImage = SwtUtils.convertToSwt(display, inImage, true, -1);
- assertNotNull(outImage);
-
- ImageData outData = outImage.getImageData();
- assertEquals(inImage.getWidth(), outData.width);
- assertEquals(inImage.getHeight(), outData.height);
- assertEquals(SWT.TRANSPARENCY_ALPHA, outData.getTransparencyType());
-
- PaletteData inPalette = SwtUtils.getAwtPaletteData(inImage.getType());
- PaletteData outPalette = outData.palette;
-
- for (int y = 0; y < outData.height; y++) {
- for (int x = 0; x < outData.width; x++) {
- RGB expected = inPalette.getRGB( inImage.getRGB( x, y));
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
-
- // Note: >> instead of >>> since we will compare with byte (a signed number)
- int expectedAlpha = inImage.getRGB(x, y) >> 24;
- int actualAlpha = outData.alphaData[y * outData.width + x];
- assertEquals(expectedAlpha, actualAlpha);
- }
- }
- }
-
- public void testImageConvertAlphaMultiplied() throws Exception {
- BufferedImage inImage = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
- Graphics g = inImage.getGraphics();
- g.setColor(new Color(0xAA112233, true));
- g.fillRect(0, 0, inImage.getWidth(), inImage.getHeight());
- g.dispose();
-
- Shell shell = new Shell();
- Display display = shell.getDisplay();
- Image outImage = SwtUtils.convertToSwt(display, inImage, true, 32);
- assertNotNull(outImage);
-
- // Expected alpha is 0xAA from the AWT input image pre-multiplied by 32 in convertToSwt.
- int expectedAlpha = (0xAA * 32) >> 8;
-
- ImageData outData = outImage.getImageData();
- assertEquals(inImage.getWidth(), outData.width);
- assertEquals(inImage.getHeight(), outData.height);
- assertEquals(SWT.TRANSPARENCY_ALPHA, outData.getTransparencyType());
-
- PaletteData inPalette = SwtUtils.getAwtPaletteData(inImage.getType());
- PaletteData outPalette = outData.palette;
-
- for (int y = 0; y < outData.height; y++) {
- for (int x = 0; x < outData.width; x++) {
- RGB expected = inPalette.getRGB( inImage.getRGB( x, y));
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
-
- byte actualAlpha = outData.alphaData[y * outData.width + x];
- assertEquals(expectedAlpha, actualAlpha);
- }
- }
- }
-
- public final void testSetRectangle() {
- Rect r = new Rect(1, 2, 3, 4);
- Rectangle r2 = new Rectangle(3, 4, 20, 30);
- SwtUtils.set(r, r2);
-
- assertEquals(3, r.x);
- assertEquals(4, r.y);
- assertEquals(20, r.w);
- assertEquals(30, r.h);
- }
-
- public final void testRectRectangle() {
- Rectangle r = new Rectangle(3, 4, 20, 30);
- Rect r2 = SwtUtils.toRect(r);
-
- assertEquals(3, r2.x);
- assertEquals(4, r2.y);
- assertEquals(20, r2.w);
- assertEquals(30, r2.h);
- }
-
- public final void testCropEmpty() {
- Image image = createSampleImage(256, 256);
- Image result = SwtUtils.drawRectangles(image, Collections.<Rectangle> emptyList(), null,
- 1.0, (byte) 121);
- assertNull(result);
- }
-
- public final void testCrop1() {
- Image image = createSampleImage(256, 256);
-
- byte alpha = 121;
- double scale = 1.0;
-
- List<Rectangle> items = new ArrayList<Rectangle>();
- items.add(new Rectangle(30, 60, 20, 20));
- Image result =
- SwtUtils.drawRectangles(image, items, ImageUtils.getBoundingRectangle(items),
- scale, alpha);
-
- assertNotNull(result);
- ImageData outData = result.getImageData();
- assertEquals(20, outData.width);
- assertEquals(20, outData.height);
-
- PaletteData outPalette = outData.palette;
- assertNotNull(outPalette);
-
- byte[] outAlphaData = outData.alphaData;
- assertNotNull(outAlphaData);
-
- for (int y = 0; y < 20; y++) {
- for (int x = 0; x < 20; x++) {
- int r = y + 60;
- int g = x + 30;
-
- RGB expected = new RGB(r, g, 0);
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
-
- byte actualAlpha = outAlphaData[y*20+x];
- assertEquals(alpha, actualAlpha);
- }
- }
- }
-
- public final void testCrop2() {
- Image image = createSampleImage(256, 256);
-
- byte alpha = 121;
- double scale = 1.0;
-
- List<Rectangle> items = new ArrayList<Rectangle>();
- items.add(new Rectangle(10, 10, 20, 20));
- items.add(new Rectangle(110, 80, 20, 20));
- Image result =
- SwtUtils.drawRectangles(image, items, ImageUtils.getBoundingRectangle(items),
- scale, alpha);
-
- assertNotNull(result);
- ImageData outData = result.getImageData();
- assertEquals(120, outData.width);
- assertEquals(90, outData.height);
-
- PaletteData outPalette = outData.palette;
- assertNotNull(outPalette);
-
- byte[] outAlphaData = outData.alphaData;
- assertNotNull(outAlphaData);
-
- for (int y = 0; y < 20; y++) {
- for (int x = 0; x < 20; x++) {
- int r = y + 10;
- int g = x + 10;
-
- RGB expected = new RGB(r, g, 0);
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
-
- assertEquals(alpha, outAlphaData[y*120+x]);
- }
- }
- for (int y = 70; y < 90; y++) {
- for (int x = 100; x < 120; x++) {
- int r = y + 10;
- int g = x + 10;
-
- RGB expected = new RGB(r, g, 0);
- RGB actual = outPalette.getRGB(outData.getPixel(x, y));
- assertEquals(expected, actual);
-
- assertEquals(alpha, outAlphaData[y*120+x]);
- }
- }
- assertEquals(0, outAlphaData[40]);
- }
-
- /**
- * Crop test utility: Create a sample image patterned with red=y and green=x, suitable
- * for checking that in image copying operations we've copied and scaled the right
- * bits. (Obviously the red/green will be mod'ed with 256).
- *
- * @param imageWidth the width of the target image
- * @param imageHeight the height of the target image
- * @return a new image with a red/green pattern
- */
- private Image createSampleImage(int imageWidth, int imageHeight) {
- Shell shell = new Shell();
- Display display = shell.getDisplay();
-
- ImageData data = new ImageData(imageWidth, imageHeight, 32, new PaletteData(0x00FF0000,
- 0x0000FF00, 0x000000FF));
- for (int y = 0; y < imageHeight; y++) {
- for (int x = 0; x < imageWidth; x++) {
- int pixelValue = (y & 0xFF) << 16 | (x & 0xFF) << 8;
- data.setPixel(x, y, pixelValue);
- }
- }
- Image image = new Image(display, data);
- return image;
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/MockNodeProxy.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/MockNodeProxy.java
deleted file mode 100755
index 433d3903d..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/MockNodeProxy.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gre;
-
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
-
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.ui.internal.registry.ViewDescriptor;
-
-/**
- * Mocks a {@link NodeProxy}, creating it using an XML local name and generating
- * a made-up {@link UiViewElementNode} and a {@link ViewDescriptor} on the fly.
- */
-public class MockNodeProxy extends NodeProxy {
-
- /**
- * Generates a {@link NodeProxy} using an FQCN (e.g. android.view.View)
- * and making the last segment of the FQCN the XML name of the view (e.g. "View")
- * and wraps it as a {@link NodeProxy}.
- *
- * @param fqcn The fully qualified name of the class to wrap, e.g. "android.view.Button".
- * @param bounds The bounds of a the view in the canvas. Must be either: <br/>
- * - a valid rect for a view that is actually in the canvas <br/>
- * - <b>*or*</b> null (or an invalid rect) for a view that has just been added dynamically
- * to the model. We never store a null bounds rectangle in the node, a null rectangle
- * will be converted to an invalid rectangle.
- * @param factory A {@link NodeFactory} to create unique children nodes.
- */
- public MockNodeProxy(String fqcn, Rectangle bounds, NodeFactory factory) {
- super(makeUiViewNode(fqcn), bounds, factory);
- }
-
- /**
- * Generates a {@link ViewElementDescriptor} using an FQCN (e.g. android.view.View)
- * and making the last segment of the FQCN the XML name of the view (e.g. "View").
- *
- * @param fqcn The fully qualified name of the class to wrap, e.g. "android.view.Button"
- * @return A new view element node with a new descriptor for the FQCN and an XML name
- * matching the last FQCN segment (e.g. "Button")
- */
- private static UiViewElementNode makeUiViewNode(String fqcn) {
- String xmlName = fqcn;
- int pos = xmlName.lastIndexOf('.');
- if (pos > 0) {
- xmlName = xmlName.substring(pos + 1);
- }
-
- ViewElementDescriptor desc = new ViewElementDescriptor(xmlName, fqcn);
- UiViewElementNode uiNode = new UiViewElementNode(desc);
- return uiNode;
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeFactoryTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeFactoryTest.java
deleted file mode 100755
index 0e6d33db3..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/NodeFactoryTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gre;
-
-import com.android.ide.common.api.INode;
-import com.android.ide.common.api.Rect;
-import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
-import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-public class NodeFactoryTest extends TestCase {
-
- private NodeFactory m;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- m = new NodeFactory(null);
-
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- m = null;
- }
-
- public final void testCreateCanvasViewInfo() {
- ViewElementDescriptor ved = new ViewElementDescriptor("xml", "com.example.MyJavaClass");
- UiViewElementNode uiv = new UiViewElementNode(ved);
- ViewInfo lvi = new ViewInfo("name", uiv, 10, 12, 110, 120);
- CanvasViewInfo cvi = CanvasViewInfo.create(lvi, true /* layoutlib5 */).getFirst();
-
- // Create a NodeProxy.
- NodeProxy proxy = m.create(cvi);
-
- // getNode() is our only internal implementation method.
- assertNotNull(proxy);
- assertSame(uiv, proxy.getNode());
-
- // Groovy scripts only see the INode interface so we want to primarily test that.
- INode inode = proxy;
- assertEquals(new Rect(10, 12, 110-10-1, 120-12-1), inode.getBounds());
- assertTrue(Arrays.equals(new INode[0], inode.getChildren()));
- assertEquals("com.example.MyJavaClass", inode.getFqcn());
- assertNull(inode.getParent());
- assertSame(inode, inode.getRoot());
-
- }
-
- public final void testCreateUiViewElementNode() {
- ViewElementDescriptor ved = new ViewElementDescriptor("xml", "com.example.MyJavaClass");
- UiViewElementNode uiv = new UiViewElementNode(ved);
-
- // Create a NodeProxy.
- NodeProxy proxy = m.create(uiv);
-
- // getNode() is our only internal implementation method.
- assertNotNull(proxy);
- assertSame(uiv, proxy.getNode());
-
- // Groovy scripts only see the INode interface so we want to primarily test that.
- INode inode = proxy;
- // Nodes constructed using this create() method do not have valid bounds.
- // There should be one invalid bound rectangle.
- assertNotNull(inode.getBounds());
- assertFalse(inode.getBounds().isValid());
- // All the other properties should be set correctly.
- assertTrue(Arrays.equals(new INode[0], inode.getChildren()));
- assertEquals("com.example.MyJavaClass", inode.getFqcn());
- assertNull(inode.getParent());
- assertSame(inode, inode.getRoot());
- }
-
- public final void testCreateDup() {
- ViewElementDescriptor ved = new ViewElementDescriptor("xml", "com.example.MyJavaClass");
- UiViewElementNode uiv = new UiViewElementNode(ved);
- ViewInfo lvi = new ViewInfo("name", uiv, 10, 12, 110, 120);
- CanvasViewInfo cvi = CanvasViewInfo.create(lvi, true /* layoutlib5 */).getFirst();
-
- // NodeProxies are cached. Creating the same one twice returns the same proxy.
- NodeProxy proxy1 = m.create(cvi);
- NodeProxy proxy2 = m.create(cvi);
- assertSame(proxy2, proxy1);
- }
-
- public final void testClear() {
- ViewElementDescriptor ved = new ViewElementDescriptor("xml", "com.example.MyJavaClass");
- UiViewElementNode uiv = new UiViewElementNode(ved);
- ViewInfo lvi = new ViewInfo("name", uiv, 10, 12, 110, 120);
- CanvasViewInfo cvi = CanvasViewInfo.create(lvi, true /* layoutlib5 */).getFirst();
-
- // NodeProxies are cached. Creating the same one twice returns the same proxy.
- NodeProxy proxy1 = m.create(cvi);
- NodeProxy proxy2 = m.create(cvi);
- assertSame(proxy2, proxy1);
-
- // Clearing the cache will force it create a new proxy.
- m.clear();
- NodeProxy proxy3 = m.create(cvi);
- assertNotSame(proxy1, proxy3);
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngineTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngineTest.java
deleted file mode 100755
index d9a1a3dc1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngineTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2010 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.editors.layout.gre;
-
-import junit.framework.TestCase;
-
-public class RulesEngineTest extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testDummy() {
- // Here to avoid warning that RulesEngineTest is empty
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepositoryTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepositoryTest.java
deleted file mode 100644
index 50d438cdb..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepositoryTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011 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.editors.layout.gre;
-
-import com.android.ide.common.api.IViewMetadata.FillPreference;
-import com.android.ide.eclipse.adt.internal.editors.layout.gre.ViewMetadataRepository.RenderMode;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-public class ViewMetadataRepositoryTest extends TestCase {
- public void testSingleton() throws Exception {
- assertSame(ViewMetadataRepository.get(), ViewMetadataRepository.get());
- }
-
- public void testBasic() throws Exception {
- ViewMetadataRepository repository = ViewMetadataRepository.get();
-
- assertEquals(FillPreference.WIDTH_IN_VERTICAL,
- repository.getFillPreference("android.widget.Spinner"));
- assertEquals(FillPreference.NONE,
- repository.getFillPreference("foo.bar"));
- }
-
- // Ensure that all basenames referenced in the metadata refer to other views in the file
- // (e.g. no typos)
- public void testRelatedTo() throws Exception {
- // Make sure unit tests are run with assertions on
- boolean assertionsEnabled = false;
- assert assertionsEnabled = true; // Intentional assignment
- assertTrue("This unit test must be run with assertions enabled (-ea)", assertionsEnabled);
-
- ViewMetadataRepository repository = ViewMetadataRepository.get();
- for (String fqcn : repository.getAllFqcns()) {
- repository.getRelatedTo(fqcn);
- }
- }
-
- public void testSkip() throws Exception {
- ViewMetadataRepository repository = ViewMetadataRepository.get();
- assertTrue(repository.getSkip("merge"));
- assertFalse(repository.getSkip("android.widget.Button"));
- }
-
- public void testRenderMode() throws Exception {
- ViewMetadataRepository repository = ViewMetadataRepository.get();
- assertEquals(RenderMode.NORMAL, repository.getRenderMode("android.widget.Button"));
- assertEquals(RenderMode.SKIP, repository.getRenderMode("android.widget.LinearLayout"));
- assertEquals(RenderMode.ALONE, repository.getRenderMode("android.widget.TabHost"));
- }
-
- public void testGetTopAttributes() throws Exception {
- ViewMetadataRepository repository = ViewMetadataRepository.get();
- assertEquals(Arrays.asList("id", "text", "style"),
- repository.getTopAttributes("android.widget.RadioButton"));
- assertEquals(Arrays.asList("id", "gravity", "paddingLeft", "paddingRight", "checkMark",
- "textAppearance"),
- repository.getTopAttributes("android.widget.CheckedTextView"));
- assertEquals(Arrays.asList("id"),
- repository.getTopAttributes("android.widget.NonExistent"));
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleterTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleterTest.java
deleted file mode 100644
index 0014fe574..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleterTest.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.editors.layout.properties;
-
-import static com.android.SdkConstants.ANDROID_URI;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.common.api.IAttributeInfo;
-import com.android.ide.common.api.IAttributeInfo.Format;
-import com.android.ide.common.layout.TestAttributeInfo;
-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.TextAttributeDescriptor;
-
-import org.eclipse.jface.fieldassist.IContentProposal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.EnumSet;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class ValueCompleterTest extends TestCase {
- private void checkCompletion(String text, int offset,
- String property, EnumSet<Format> formats, String[] values,
- List<String> expected) {
- assertTrue(text.length() >= offset);
-
- TestAttributeInfo info =
- new TestAttributeInfo(property, formats, "unittest", values, values, null);
- TestValueCompleter completer = new TestValueCompleter(
- new TestTextAttributeDescriptor(property, info));
- IContentProposal[] proposals = completer.getProposals(text, offset);
- List<String> actual = new ArrayList<String>();
- for (IContentProposal proposal : proposals) {
- String content = proposal.getContent();
- actual.add(content);
- }
- assertEquals(expected.toString(), actual.toString());
- }
-
- public void test() throws Exception {
- checkCompletion("@android:string", 3, "text",
- EnumSet.of(Format.REFERENCE), null,
- Arrays.asList(new String[] { }));
- }
-
- public void test1a() throws Exception {
- checkCompletion("matc", 4, "layout_width",
- EnumSet.of(Format.DIMENSION, Format.ENUM),
- new String[] { "fill_parent", "match_parent", "wrap_content" },
-
- Arrays.asList(new String[] { "match_parent", "fill_parent", "wrap_content" }));
- }
-
- public void test1b() throws Exception {
- checkCompletion("fi", 2, "layout_width",
- EnumSet.of(Format.DIMENSION, Format.ENUM),
- new String[] { "fill_parent", "match_parent", "wrap_content" },
-
- Arrays.asList(new String[] { "fill_parent", "match_parent", "wrap_content" }));
- }
-
- public void test2() throws Exception {
- checkCompletion("50", 2, "layout_width",
- EnumSet.of(Format.DIMENSION, Format.ENUM),
- new String[] { "fill_parent", "match_parent", "wrap_content" },
-
- Arrays.asList(new String[] { "50dp", "fill_parent", "match_parent",
- "wrap_content" }));
- }
-
- public void test3() throws Exception {
- checkCompletion("42", 2, "textSize",
- EnumSet.of(Format.DIMENSION),
- null,
-
- Arrays.asList(new String[] { "42sp", "42dp" }));
- }
-
- public void test4() throws Exception {
- checkCompletion("", 0, "gravity",
- EnumSet.of(Format.FLAG),
- new String[] { "top", "bottom", "left", "right", "center" },
-
- Arrays.asList(new String[] { "top", "bottom", "left", "right", "center" }));
- }
-
- public void test5() throws Exception {
- checkCompletion("left", 4, "gravity",
- EnumSet.of(Format.FLAG),
- new String[] { "top", "bottom", "left", "right", "center" },
-
- Arrays.asList(new String[] {
- "left", "left|top", "left|bottom", "left|right", "left|center" }));
- }
-
- public void test6() throws Exception {
- checkCompletion("left|top", 8, "gravity",
- EnumSet.of(Format.FLAG),
- new String[] { "top", "bottom", "left", "right", "center" },
-
- Arrays.asList(new String[] {
- "left|top", "left|top|bottom", "left|top|right", "left|top|center" }));
- }
-
- // TODO ?android
-
- private class TestTextAttributeDescriptor extends TextAttributeDescriptor {
- public TestTextAttributeDescriptor(String xmlLocalName, IAttributeInfo attrInfo) {
- super(xmlLocalName, ANDROID_URI, attrInfo);
- }
- }
-
- private class TestValueCompleter extends ValueCompleter {
- private final AttributeDescriptor mDescriptor;
-
- TestValueCompleter(AttributeDescriptor descriptor) {
- mDescriptor = descriptor;
- assert descriptor.getAttributeInfo() != null;
- }
-
- @Override
- @Nullable
- protected CommonXmlEditor getEditor() {
- return null;
- }
-
- @Override
- @NonNull
- protected AttributeDescriptor getDescriptor() {
- return mDescriptor;
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiElementNodeTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiElementNodeTest.java
deleted file mode 100644
index d19f933d0..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiElementNodeTest.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2007 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.editors.manifest.model;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor.Mandatory;
-import com.android.ide.eclipse.adt.internal.editors.mock.MockXmlNode;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-import com.android.utils.XmlUtils;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.util.Iterator;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class UiElementNodeTest extends TestCase {
-
- private UiElementNode ui;
- private ElementDescriptor mManifestDesc;
- private ElementDescriptor mAppDesc;
- private ElementDescriptor mUsesSdkDesc;
-
- @Override
- protected void setUp() throws Exception {
- mAppDesc = new ElementDescriptor("application", new ElementDescriptor[] {
- new ElementDescriptor("provider"),
- new ElementDescriptor("activity", new ElementDescriptor[] {
- new ElementDescriptor("intent-filter")
- }),
- }, Mandatory.MANDATORY_LAST);
-
- mUsesSdkDesc = new ElementDescriptor("uses-sdk", new ElementDescriptor[] {},
- Mandatory.MANDATORY);
-
- mManifestDesc = new ElementDescriptor("manifest", new ElementDescriptor[] {
- mAppDesc,
- mUsesSdkDesc,
- new ElementDescriptor("permission")
- }, Mandatory.MANDATORY);
-
- ui = new UiElementNode(mManifestDesc);
-
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- // pass
- }
-
- /**
- * Check initialization values for ui node
- */
- public void testInit() {
- assertSame(mManifestDesc, ui.getDescriptor());
- assertNull(ui.getUiParent());
- assertEquals(0, ui.getUiChildren().size());
- assertEquals(0, ui.getAllUiAttributes().size());
- }
-
- /**
- * We declared the descriptors as having a "mandatory last" application element
- * and a mandatory non-last uses-sdk element. This means if we create an empty
- * UiModel, we should get these two created, with the application element after
- * the uses-sdk.
- */
- public void testMandatoryOrder() {
- // Add the mandatory nodes with no XML backing, do it explicitly in the wrong order.
- assertEquals(0, ui.getUiChildren().size());
- ui.appendNewUiChild(mAppDesc);
- ui.appendNewUiChild(mUsesSdkDesc);
-
- assertEquals(2, ui.getUiChildren().size());
- assertSame(mAppDesc, ui.getUiChildren().get(0).getDescriptor());
- assertSame(mUsesSdkDesc, ui.getUiChildren().get(1).getDescriptor());
-
- // Parse an XML with just a manifest.
- MockXmlNode root = new MockXmlNode(null /* namespace */, "manifest", Node.ELEMENT_NODE,
- new MockXmlNode[] {
- new MockXmlNode(null /* namespace */, "application", Node.ELEMENT_NODE, null)
- });
-
- ui.loadFromXmlNode(root);
-
- // We should get 2 children, the 2 mandatory nodes but this time with uses-sdk
- // before application since it's a mandatory-last so it "moves" to the end if possible.
- assertEquals(2, ui.getUiChildren().size());
- assertSame(mUsesSdkDesc, ui.getUiChildren().get(0).getDescriptor());
- assertNull(ui.getUiChildren().get(0).getXmlNode());
- assertSame(mAppDesc, ui.getUiChildren().get(1).getDescriptor());
- assertNotNull(ui.getUiChildren().get(1).getXmlNode());
- }
-
- /**
- * loadFrom() does nothing if the root node doesn't match what's expected
- */
- public void testLoadFrom_InvalidRoot() {
- assertEquals(0, ui.getUiChildren().size());
- MockXmlNode root = new MockXmlNode(null /* namespace */, "blah", Node.ELEMENT_NODE, null);
- ui.loadFromXmlNode(root);
- assertEquals(0, ui.getUiChildren().size());
- }
-
- /**
- * UiElementNode.loadFrom should be used to populate an empty ui node from an
- * existing XML node tree.
- */
- public void testLoadFrom_NewTree_1_Node() {
- MockXmlNode root = new MockXmlNode(null /* namespace */, "manifest", Node.ELEMENT_NODE,
- new MockXmlNode[] {
- new MockXmlNode(null /* namespace */, "application", Node.ELEMENT_NODE, null)
- });
-
- // get /manifest
- ui.loadFromXmlNode(root);
- assertEquals("manifest", ui.getDescriptor().getXmlName());
- assertEquals(1, ui.getUiChildren().size());
- assertEquals(0, ui.getAllUiAttributes().size());
-
- // get /manifest/application
- Iterator<UiElementNode> ui_child_it = ui.getUiChildren().iterator();
- UiElementNode application = ui_child_it.next();
- assertEquals("application", application.getDescriptor().getXmlName());
- assertEquals(0, application.getUiChildren().size());
- assertEquals(0, application.getAllUiAttributes().size());
- }
-
-
- public void testLoadFrom_NewTree_2_Nodes() {
- MockXmlNode root = new MockXmlNode(null /* namespace */, "manifest", Node.ELEMENT_NODE,
- new MockXmlNode[] {
- new MockXmlNode(null /* namespace */, "application", Node.ELEMENT_NODE, null),
- new MockXmlNode(null /* namespace */, "permission", Node.ELEMENT_NODE, null),
- });
-
- // get /manifest
- ui.loadFromXmlNode(root);
- assertEquals("manifest", ui.getDescriptor().getXmlName());
- assertEquals(2, ui.getUiChildren().size());
- assertEquals(0, ui.getAllUiAttributes().size());
-
- // get /manifest/application
- Iterator<UiElementNode> ui_child_it = ui.getUiChildren().iterator();
- UiElementNode application = ui_child_it.next();
- assertEquals("application", application.getDescriptor().getXmlName());
- assertEquals(0, application.getUiChildren().size());
- assertEquals(0, application.getAllUiAttributes().size());
- assertEquals(0, application.getUiSiblingIndex());
-
- // get /manifest/permission
- UiElementNode first_permission = ui_child_it.next();
- assertEquals("permission", first_permission.getDescriptor().getXmlName());
- assertEquals(0, first_permission.getUiChildren().size());
- assertEquals(0, first_permission.getAllUiAttributes().size());
- assertEquals(1, first_permission.getUiSiblingIndex());
- }
-
- public void testLoadFrom_NewTree_N_Nodes() {
- MockXmlNode root = new MockXmlNode(null /* namespace */, "manifest", Node.ELEMENT_NODE,
- new MockXmlNode[] {
- new MockXmlNode(null /* namespace */, "application", Node.ELEMENT_NODE,
- new MockXmlNode[] {
- new MockXmlNode(null /* namespace */, "activity", Node.ELEMENT_NODE,
- null),
- new MockXmlNode(null /* namespace */, "activity", Node.ELEMENT_NODE,
- new MockXmlNode[] {
- new MockXmlNode(null /* namespace */, "intent-filter",
- Node.ELEMENT_NODE, null),
- }),
- new MockXmlNode(null /* namespace */, "provider", Node.ELEMENT_NODE,
- null),
- new MockXmlNode(null /* namespace */, "provider", Node.ELEMENT_NODE,
- null),
- }),
- new MockXmlNode(null /* namespace */, "permission", Node.ELEMENT_NODE,
- null),
- new MockXmlNode(null /* namespace */, "permission", Node.ELEMENT_NODE,
- null),
- });
-
- // get /manifest
- ui.loadFromXmlNode(root);
- assertEquals("manifest", ui.getDescriptor().getXmlName());
- assertEquals(3, ui.getUiChildren().size());
- assertEquals(0, ui.getAllUiAttributes().size());
-
- // get /manifest/application
- Iterator<UiElementNode> ui_child_it = ui.getUiChildren().iterator();
- UiElementNode application = ui_child_it.next();
- assertEquals("application", application.getDescriptor().getXmlName());
- assertEquals(4, application.getUiChildren().size());
- assertEquals(0, application.getAllUiAttributes().size());
-
- // get /manifest/application/activity #1
- Iterator<UiElementNode> app_child_it = application.getUiChildren().iterator();
- UiElementNode first_activity = app_child_it.next();
- assertEquals("activity", first_activity.getDescriptor().getXmlName());
- assertEquals(0, first_activity.getUiChildren().size());
- assertEquals(0, first_activity.getAllUiAttributes().size());
-
- // get /manifest/application/activity #2
- UiElementNode second_activity = app_child_it.next();
- assertEquals("activity", second_activity.getDescriptor().getXmlName());
- assertEquals(1, second_activity.getUiChildren().size());
- assertEquals(0, second_activity.getAllUiAttributes().size());
-
- // get /manifest/application/activity #2/intent-filter #1
- Iterator<UiElementNode> activity_child_it = second_activity.getUiChildren().iterator();
- UiElementNode intent_filter = activity_child_it.next();
- assertEquals("intent-filter", intent_filter.getDescriptor().getXmlName());
- assertEquals(0, intent_filter.getUiChildren().size());
- assertEquals(0, intent_filter.getAllUiAttributes().size());
-
- // get /manifest/application/provider #1
- UiElementNode first_provider = app_child_it.next();
- assertEquals("provider", first_provider.getDescriptor().getXmlName());
- assertEquals(0, first_provider.getUiChildren().size());
- assertEquals(0, first_provider.getAllUiAttributes().size());
-
- // get /manifest/application/provider #2
- UiElementNode second_provider = app_child_it.next();
- assertEquals("provider", second_provider.getDescriptor().getXmlName());
- assertEquals(0, second_provider.getUiChildren().size());
- assertEquals(0, second_provider.getAllUiAttributes().size());
-
- // get /manifest/permission #1
- UiElementNode first_permission = ui_child_it.next();
- assertEquals("permission", first_permission.getDescriptor().getXmlName());
- assertEquals(0, first_permission.getUiChildren().size());
- assertEquals(0, first_permission.getAllUiAttributes().size());
-
- // get /manifest/permission #1
- UiElementNode second_permission = ui_child_it.next();
- assertEquals("permission", second_permission.getDescriptor().getXmlName());
- assertEquals(0, second_permission.getUiChildren().size());
- assertEquals(0, second_permission.getAllUiAttributes().size());
- }
-
- public void testCreateNameSpace() throws Exception {
- // Setup
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.newDocument();
- Element rootElement = document.createElement("root");
- document.appendChild(rootElement);
- Element root = document.getDocumentElement();
- root.appendChild(document.createTextNode(" "));
- Element foo = document.createElement("foo");
- root.appendChild(foo);
- root.appendChild(document.createTextNode(" "));
- Element bar = document.createElement("bar");
- root.appendChild(bar);
- Element baz = document.createElement("baz");
- root.appendChild(baz);
-
- String prefix = XmlUtils.lookupNamespacePrefix(baz, SdkConstants.ANDROID_URI);
- assertEquals("android", prefix);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java
deleted file mode 100644
index 0330216d5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNamedNodeMap.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2008 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.editors.mock;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-class MockNamedNodeMap implements NamedNodeMap {
-
- /** map for access by namespace/name */
- private final HashMap<String, HashMap<String, Node>> mNodeMap =
- new HashMap<String, HashMap<String, Node>>();
-
- /** list for access by index */
- private final ArrayList<Node> mNodeList = new ArrayList<Node>();
-
- public MockXmlNode addAttribute(String namespace, String localName, String value) {
- MockXmlNode node = new MockXmlNode(namespace, localName, value);
-
- if (namespace == null) {
- namespace = ""; // no namespace
- }
-
- // get the map for the namespace
- HashMap<String, Node> map = mNodeMap.get(namespace);
- if (map == null) {
- map = new HashMap<String, Node>();
- mNodeMap.put(namespace, map);
- }
-
-
- map.put(localName, node);
- mNodeList.add(node);
-
- return node;
- }
-
- // --------- NamedNodeMap -------
-
- @Override
- public int getLength() {
- return mNodeList.size();
- }
-
- @Override
- public Node getNamedItem(String name) {
- HashMap<String, Node> map = mNodeMap.get(""); // no namespace
- if (map != null) {
- return map.get(name);
- }
-
- return null;
- }
-
- @Override
- public Node getNamedItemNS(String namespaceURI, String localName) throws DOMException {
- if (namespaceURI == null) {
- namespaceURI = ""; //no namespace
- }
-
- HashMap<String, Node> map = mNodeMap.get(namespaceURI);
- if (map != null) {
- return map.get(localName);
- }
-
- return null;
- }
-
- @Override
- public Node item(int index) {
- return mNodeList.get(index);
- }
-
- @Override
- public Node removeNamedItem(String name) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Node setNamedItem(Node arg) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Node setNamedItemNS(Node arg) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java
deleted file mode 100644
index ff9df19a1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockNodeList.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2007 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.editors.mock;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-
-
-/**
- * A quick mock implementation of NodeList on top of ArrayList.
- */
-public class MockNodeList implements NodeList {
-
- ArrayList<MockXmlNode> mChildren;
-
- /**
- * Constructs a node list from a given children list.
- *
- * @param children The children list. Can be null.
- */
- public MockNodeList(MockXmlNode[] children) {
- mChildren = new ArrayList<MockXmlNode>();
- if (children != null) {
- for (MockXmlNode n : children) {
- mChildren.add(n);
- }
- }
- }
-
- @Override
- public int getLength() {
- return mChildren.size();
- }
-
- @Override
- public Node item(int index) {
- if (index >= 0 && index < mChildren.size()) {
- return mChildren.get(index);
- }
- return null;
- }
-
- public ArrayList<MockXmlNode> getArrayList() {
- return mChildren;
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java
deleted file mode 100644
index 77de2c822..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/mock/MockXmlNode.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright (C) 2007 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.editors.mock;
-
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.UserDataHandler;
-
-import java.util.HashMap;
-
-
-/**
- * A mock XML node with only a minimal set of information.
- */
-public class MockXmlNode implements Node {
-
- MockNodeList mNodeList;
- private String mLocalName;
- private String mNamespace;
- private short mNodeType;
- private MockXmlNode mParent;
- private MockXmlNode mPreviousSibling;
- private MockXmlNode mNextSibling;
- private String mAttrValue;
- private MockNamedNodeMap mAttributes;
-
- // namespace stuff only set in the root node
- /** map from namespace to prefix. */
- private HashMap<String, String> mNsMap = null;
-
- /**
- * Constructs a node from a given children list.
- *
- * @param namespace The namespace of the node or null if none
- * @param localName The XML local node name.
- * @param node_type One of Node.xxx_NODE constants, e.g. Node.ELEMENT_NODE
- * @param children The children list. Can be null.
- */
- public MockXmlNode(String namespace, String localName, short node_type,
- MockXmlNode[] children) {
- mLocalName = localName;
- mNamespace = namespace;
- mNodeType = node_type;
- mNodeList = new MockNodeList(children);
- fixNavigation();
- }
-
- /**
- * Constructs an attribute node
- *
- * @param namespace The namespace of the node or null if none
- * @param localName The XML local node name.
- * @param value the value of the attribute
- */
- public MockXmlNode(String namespace, String localName, String value) {
- mLocalName = localName;
- mNamespace = namespace;
- mAttrValue = value;
- mNodeType = Node.ATTRIBUTE_NODE;
- mNodeList = new MockNodeList(new MockXmlNode[0]);
- fixNavigation();
- }
-
- private void fixNavigation() {
- MockXmlNode prev = null;
- for (MockXmlNode n : mNodeList.getArrayList()) {
- n.mParent = this;
- n.mPreviousSibling = prev;
- if (prev != null) {
- prev.mNextSibling = n;
- }
- n.fixNavigation();
- prev = n;
- }
- }
-
- public void addAttributes(String namespaceURI, String localName, String value) {
- if (mAttributes == null) {
- mAttributes = new MockNamedNodeMap();
- }
-
- MockXmlNode node = mAttributes.addAttribute(namespaceURI, localName, value);
- node.mParent = this;
- }
-
- public void setPrefix(String namespace, String prefix) {
- if (mNsMap == null) {
- mNsMap = new HashMap<String, String>();
- }
-
- mNsMap.put(namespace, prefix);
- }
-
- public String getPrefix(String namespace) {
- if (mNsMap != null) {
- return mNsMap.get(namespace);
- }
-
- return mParent.getPrefix(namespace);
- }
-
-
- // ----------- Node methods
-
- @Override
- public Node appendChild(Node newChild) throws DOMException {
- mNodeList.getArrayList().add((MockXmlNode) newChild);
- return newChild;
- }
-
- @Override
- public NamedNodeMap getAttributes() {
- return mAttributes;
- }
-
- @Override
- public NodeList getChildNodes() {
- return mNodeList;
- }
-
- @Override
- public Node getFirstChild() {
- if (mNodeList.getLength() > 0) {
- return mNodeList.item(0);
- }
- return null;
- }
-
- @Override
- public Node getLastChild() {
- if (mNodeList.getLength() > 0) {
- return mNodeList.item(mNodeList.getLength() - 1);
- }
- return null;
- }
-
- @Override
- public Node getNextSibling() {
- return mNextSibling;
- }
-
- @Override
- public String getNodeName() {
- return mLocalName;
- }
-
- @Override
- public String getLocalName() {
- return mLocalName;
- }
-
- @Override
- public short getNodeType() {
- return mNodeType;
- }
-
- @Override
- public Node getParentNode() {
- return mParent;
- }
-
- @Override
- public Node getPreviousSibling() {
- return mPreviousSibling;
- }
-
- @Override
- public boolean hasChildNodes() {
- return mNodeList.getLength() > 0;
- }
-
- @Override
- public boolean hasAttributes() {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public boolean isSameNode(Node other) {
- return this == other;
- }
-
- @Override
- public String getNodeValue() throws DOMException {
- return mAttrValue;
- }
-
- @Override
- public String getPrefix() {
- return getPrefix(getNamespaceURI());
- }
-
- @Override
- public String getNamespaceURI() {
- return mNamespace;
- }
-
-
- // --- methods not implemented ---
-
- @Override
- public Node cloneNode(boolean deep) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public short compareDocumentPosition(Node other) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public String getBaseURI() {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Object getFeature(String feature, String version) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Document getOwnerDocument() {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public String getTextContent() throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Object getUserData(String key) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Node insertBefore(Node newChild, Node refChild)
- throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public boolean isDefaultNamespace(String namespaceURI) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public boolean isEqualNode(Node arg) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public boolean isSupported(String feature, String version) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public String lookupNamespaceURI(String prefix) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public String lookupPrefix(String namespaceURI) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public void normalize() {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Node removeChild(Node oldChild) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Node replaceChild(Node newChild, Node oldChild)
- throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public void setNodeValue(String nodeValue) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public void setPrefix(String prefix) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public void setTextContent(String textContent) throws DOMException {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-
- @Override
- public Object setUserData(String key, Object data,
- UserDataHandler handler) {
- throw new UnsupportedOperationException("Operation not implemented."); //$NON-NLS-1$
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java
deleted file mode 100644
index a6da135b6..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (C) 2008 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.editors.resources.manager;
-
-import com.android.SdkConstants;
-import com.android.ide.common.resources.ResourceFile;
-import com.android.ide.common.resources.ResourceFolder;
-import com.android.ide.common.resources.ResourceItem;
-import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.common.resources.SingleResourceFile;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
-import com.android.ide.eclipse.adt.io.IFileWrapper;
-import com.android.ide.eclipse.adt.io.IFolderWrapper;
-import com.android.ide.eclipse.mock.Mocks;
-import com.android.io.IAbstractFolder;
-import com.android.io.IAbstractResource;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.NightMode;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.TouchScreen;
-import com.android.resources.UiMode;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-
-import junit.framework.TestCase;
-
-public class ConfigMatchTest extends TestCase {
- private static final String SEARCHED_FILENAME = "main.xml"; //$NON-NLS-1$
- private static final String MISC1_FILENAME = "foo.xml"; //$NON-NLS-1$
- private static final String MISC2_FILENAME = "bar.xml"; //$NON-NLS-1$
-
- private FolderConfiguration mDefaultConfig;
- private ResourceRepository mResources;
- private FolderConfiguration config4;
- private FolderConfiguration config3;
- private FolderConfiguration config2;
- private FolderConfiguration config1;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- // create a default config with all qualifiers.
- mDefaultConfig = new FolderConfiguration();
- mDefaultConfig.createDefault();
-
- IAbstractFolder folder = Mocks.createAbstractFolder(
- SdkConstants.FD_RESOURCES, new IAbstractResource[0]);
-
- // create the project resources.
- mResources = new ResourceRepository(folder, false) {
- @Override
- protected ResourceItem createResourceItem(String name) {
- return new ResourceItem(name);
- }
- };
-
- // create 2 arrays of IResource. one with the filename being looked up, and one without.
- // Since the required API uses IResource, we can use MockFolder for them.
- IFile[] validMemberList = new IFile[] {
- Mocks.createFile(MISC1_FILENAME),
- Mocks.createFile(SEARCHED_FILENAME),
- Mocks.createFile(MISC2_FILENAME),
- };
- IFile[] invalidMemberList = new IFile[] {
- Mocks.createFile(MISC1_FILENAME),
- Mocks.createFile(MISC2_FILENAME),
- };
-
- // add multiple ResourceFolder to the project resource.
- FolderConfiguration defaultConfig = getConfiguration(
- null, // country code
- null, // network code
- null, // language
- null, // region
- null, // smallest width dp
- null, // width dp
- null, // height dp
- null, // screen size
- null, // screen ratio
- null, // screen orientation
- null, // dock mode
- null, // night mode
- null, // dpi
- null, // touch mode
- null, // keyboard state
- null, // text input
- null, // navigation state
- null, // navigation method
- null, // screen dimension
- null);// version
-
- addFolder(mResources, defaultConfig, validMemberList);
-
- config1 = getConfiguration(
- null, // country code
- null, // network code
- "en", // language
- null, // region
- null, // smallest width dp
- null, // width dp
- null, // height dp
- null, // screen size
- null, // screen ratio
- null, // screen orientation
- null, // dock mode
- null, // night mode
- null, // dpi
- null, // touch mode
- KeyboardState.EXPOSED.getResourceValue(), // keyboard state
- null, // text input
- null, // navigation state
- null, // navigation method
- null, // screen dimension
- null);// version
-
- addFolder(mResources, config1, validMemberList);
-
- config2 = getConfiguration(
- null, // country code
- null, // network code
- "en", // language
- null, // region
- null, // smallest width dp
- null, // width dp
- null, // height dp
- null, // screen size
- null, // screen ratio
- null, // screen orientation
- null, // dock mode
- null, // night mode
- null, // dpi
- null, // touch mode
- KeyboardState.HIDDEN.getResourceValue(), // keyboard state
- null, // text input
- null, // navigation state
- null, // navigation method
- null, // screen dimension
- null);// version
-
- addFolder(mResources, config2, validMemberList);
-
- config3 = getConfiguration(
- null, // country code
- null, // network code
- "en", // language
- null, // region
- null, // smallest width dp
- null, // width dp
- null, // height dp
- null, // screen size
- null, // screen ratio
- ScreenOrientation.LANDSCAPE.getResourceValue(), // screen orientation
- null, // dock mode
- null, // night mode
- null, // dpi
- null, // touch mode
- null, // keyboard state
- null, // text input
- null, // navigation state
- null, // navigation method
- null, // screen dimension
- null);// version
-
- addFolder(mResources, config3, validMemberList);
-
- config4 = getConfiguration(
- "mcc310", // country code
- "mnc435", // network code
- "en", // language
- "rUS", // region
- null, // smallest width dp
- null, // width dp
- null, // height dp
- "normal", // screen size
- "notlong", // screen ratio
- ScreenOrientation.LANDSCAPE.getResourceValue(), // screen orientation
- UiMode.DESK.getResourceValue(), // dock mode
- NightMode.NIGHT.getResourceValue(), // night mode
- "mdpi", // dpi
- TouchScreen.FINGER.getResourceValue(), // touch mode
- KeyboardState.EXPOSED.getResourceValue(), // keyboard state
- Keyboard.QWERTY.getResourceValue(), // text input
- NavigationState.EXPOSED.getResourceValue(), // navigation state
- Navigation.DPAD.getResourceValue(), // navigation method
- "480x320", // screen dimension
- "v3"); // version
-
- addFolder(mResources, config4, invalidMemberList);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- mResources = null;
- }
-
- public void test1() {
- FolderConfiguration testConfig = getConfiguration(
- "mcc310", // country code
- "mnc435", // network code
- "en", // language
- "rUS", // region
- null, // smallest width dp
- null, // width dp
- null, // height dp
- "normal", // screen size
- "notlong", // screen ratio
- ScreenOrientation.LANDSCAPE.getResourceValue(), // screen orientation
- UiMode.DESK.getResourceValue(), // dock mode
- NightMode.NIGHT.getResourceValue(), // night mode
- "mdpi", // dpi
- TouchScreen.FINGER.getResourceValue(), // touch mode
- KeyboardState.EXPOSED.getResourceValue(), // keyboard state
- Keyboard.QWERTY.getResourceValue(), // text input
- NavigationState.EXPOSED.getResourceValue(), // navigation state
- Navigation.DPAD.getResourceValue(), // navigation method
- "480x320", // screen dimension
- "v3"); // version
-
- ResourceFile result = mResources.getMatchingFile(SEARCHED_FILENAME,
- ResourceFolderType.LAYOUT, testConfig);
-
- boolean bresult = result.getFolder().getConfiguration().equals(config3);
- assertEquals(bresult, true);
- }
-
- /**
- * Creates a {@link FolderConfiguration}.
- * @param qualifierValues The list of qualifier values. The length must equals the total number
- * of Qualifiers. <code>null</code> is permitted and will make the FolderConfiguration not use
- * this particular qualifier.
- */
- private FolderConfiguration getConfiguration(String... qualifierValues) {
- // FolderConfiguration.getQualifierCount is always valid and up to date.
- final int count = FolderConfiguration.getQualifierCount();
-
- // Check we have the right number of qualifier.
- assertEquals(qualifierValues.length, count);
-
- FolderConfiguration config = new FolderConfiguration();
-
- for (int i = 0 ; i < count ; i++) {
- String value = qualifierValues[i];
- if (value != null) {
- assertTrue(mDefaultConfig.getQualifier(i).checkAndSet(value, config));
- }
- }
-
- return config;
- }
-
- /**
- * Adds a folder to the given {@link ProjectResources} with the given
- * {@link FolderConfiguration}. The folder is filled with files from the provided list.
- * @param resources the {@link ResourceRepository} in which to add the folder.
- * @param config the {@link FolderConfiguration} for the created folder.
- * @param memberList the list of files for the folder.
- */
- private void addFolder(ResourceRepository resources, FolderConfiguration config,
- IFile[] memberList) throws Exception {
-
- // figure out the folder name based on the configuration
- String folderName = config.getFolderName(ResourceFolderType.LAYOUT);
-
- // create the folder mock
- IFolder folder = Mocks.createFolder(folderName, memberList);
-
- // add it to the resource, and get back a ResourceFolder object.
- ResourceFolder resFolder = resources.processFolder(new IFolderWrapper(folder));
-
- // and fill it with files from the list.
- for (IFile file : memberList) {
- resFolder.addFile(new SingleResourceFile(new IFileWrapper(file), resFolder));
- }
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/ProjectHelperTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/ProjectHelperTest.java
deleted file mode 100644
index 22bfef560..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/project/ProjectHelperTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008 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.project;
-
-import com.android.ide.eclipse.mock.Mocks;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-
-import junit.framework.TestCase;
-
-public class ProjectHelperTest extends TestCase {
-
- /** The old container id */
- private final static String OLD_CONTAINER_ID =
- "com.android.ide.eclipse.adt.project.AndroidClasspathContainerInitializer"; //$NON-NLS-1$
-
- /** The container id for the android framework jar file */
- private final static String CONTAINER_ID =
- "com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"; //$NON-NLS-1$
-
- @Override
- public void setUp() throws Exception {
- // pass for now
- }
-
- @Override
- public void tearDown() throws Exception {
- // pass for now
- }
-
- public final void testFixProjectClasspathEntriesFromOldContainer() throws Exception {
- // create a project with a path to an android .zip
- IJavaProject javaProject = Mocks.createProject(
- new IClasspathEntry[] {
- Mocks.createClasspathEntry(new Path("Project/src"), //$NON-NLS-1$
- IClasspathEntry.CPE_SOURCE),
- Mocks.createClasspathEntry(new Path(OLD_CONTAINER_ID),
- IClasspathEntry.CPE_CONTAINER),
- },
- new Path("Project/bin"));
-
- ProjectHelper.fixProjectClasspathEntries(javaProject);
-
- IClasspathEntry[] fixedEntries = javaProject.getRawClasspath();
- assertEquals(3, fixedEntries.length);
- assertEquals("Project/src", fixedEntries[0].getPath().toString());
- assertEquals(OLD_CONTAINER_ID, fixedEntries[1].getPath().toString());
- assertEquals(CONTAINER_ID, fixedEntries[2].getPath().toString());
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java
deleted file mode 100644
index 262ea420e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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.annotations.NonNull;
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgPolicy.IMovePolicy;
-import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor;
-import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory;
-import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.CreateTargetQueries;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgQueries;
-import org.eclipse.ltk.core.refactoring.participants.MoveRefactoring;
-import org.eclipse.swt.widgets.Shell;
-
-
-@SuppressWarnings({"javadoc", "restriction"})
-public class AndroidTypeMoveParticipantTest extends RefactoringTestBase {
- public void testRefactor1() throws Exception {
- moveType(
- TEST_PROJECT2,
- "com.example.refactoringtest.CustomView1",
- "src/com/example/refactoringtest/subpackage",
- true /*updateReferences*/,
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Move resource 'testRefactor1/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'\n" +
- "\n" +
- "[x] Move resource 'testRefactor1/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor1/res/layout/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <com.example.refactoringtest.subpackage.CustomView1\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor1/res/layout-land/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <com.example.refactoringtest.subpackage.CustomView1");
- }
-
- public void testRefactorFragment() throws Exception {
- moveType(
- TEST_PROJECT2,
- "com.example.refactoringtest.MyFragment",
- "src/com/example/refactoringtest/subpackage",
- true /*updateReferences*/,
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Move resource 'testRefactorFragment/src/com/example/refactoringtest/MyFragment.java' to 'subpackage'\n" +
- "\n" +
- "[x] Move resource 'testRefactorFragment/src/com/example/refactoringtest/MyFragment.java' to 'subpackage'\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactorFragment/res/layout/activity_main.xml\n" +
- " @@ -33 +33\n" +
- " - <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
- " + <fragment android:name=\"com.example.refactoringtest.subpackage.MyFragment\"/>");
- }
-
- public void testRefactor1_norefs() throws Exception {
- moveType(
- TEST_PROJECT2,
- "com.example.refactoringtest.CustomView1",
- "src/com/example/refactoringtest/subpackage",
- false /*updateReferences*/,
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Move resource 'testRefactor1_norefs/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'\n" +
- "\n" +
- "[x] Move resource 'testRefactor1_norefs/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'");
- }
-
- // ---- Test infrastructure ----
-
- protected void moveType(
- @NonNull Object[] testData,
- @NonNull String typeFqcn,
- @NonNull String destination,
- boolean updateReferences,
- @NonNull String expected) throws Exception {
- IProject project = createProject(testData);
-
- IFolder destinationFolder = project.getFolder(destination);
-
- IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
- assertNotNull(javaProject);
- IType type = javaProject.findType(typeFqcn);
- assertNotNull(typeFqcn, type);
- assertTrue(typeFqcn, type.exists());
- IResource resource = type.getResource();
- assertNotNull(typeFqcn, resource);
- assertTrue(typeFqcn, resource.exists());
-
- IResource[] resources = new IResource[] { resource };
- IJavaElement[] elements = new IJavaElement[] { type };
- IMovePolicy policy = ReorgPolicyFactory.createMovePolicy(resources, elements);
- JavaMoveProcessor processor = new JavaMoveProcessor(policy);
- processor.setUpdateReferences(updateReferences);
- processor.setUpdateQualifiedNames(true);
- assertTrue(policy.canEnable());
- processor.setDestination(ReorgDestinationFactory.createDestination(destinationFolder));
- Shell parent = AdtPlugin.getShell();
- assertNotNull(parent);
- processor.setCreateTargetQueries(new CreateTargetQueries(parent));
- processor.setReorgQueries(new ReorgQueries(parent));
-
- MoveRefactoring refactoring = new MoveRefactoring(processor);
- checkRefactoring(refactoring, expected);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java
deleted file mode 100644
index f65124a2c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.annotations.NonNull;
-import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
-
-
-@SuppressWarnings({"javadoc", "restriction"})
-public class AndroidTypeRenameParticipantTest extends RefactoringTestBase {
- public void testRefactor1() throws Exception {
- renameType(
- TEST_PROJECT,
- "com.example.refactoringtest.MainActivity",
- true /*updateReferences*/,
- "NewActivityName",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename compilation unit 'MainActivity.java' to 'NewActivityName.java'\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactor1/res/layout/activity_main.xml\n" +
- " @@ -5 +5\n" +
- " - tools:context=\".MainActivity\" >\n" +
- " + tools:context=\".NewActivityName\" >\n" +
- "\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactor1/res/layout-land/activity_main.xml\n" +
- " @@ -5 +5\n" +
- " - tools:context=\".MainActivity\" >\n" +
- " + tools:context=\".NewActivityName\" >\n" +
- "\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\n" +
- " @@ -16 +16\n" +
- " - android:name=\"com.example.refactoringtest.MainActivity\"\n" +
- " + android:name=\"com.example.refactoringtest.NewActivityName\"");
- }
-
- public void testRefactor1b() throws Exception {
- renameType(
- TEST_PROJECT,
- "com.example.refactoringtest.MainActivity2",
- true /*updateReferences*/,
- "NewActivityName",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename compilation unit 'MainActivity2.java' to 'NewActivityName.java'\n" +
- "\n" +
- "[x] AndroidManifest.xml - /testRefactor1b/AndroidManifest.xml\n" +
- " @@ -25 +25\n" +
- " - android:name=\".MainActivity2\"\n" +
- " + android:name=\".NewActivityName\"");
- }
-
- public void testRefactor1_noreferences() throws Exception {
- renameType(
- TEST_PROJECT,
- "com.example.refactoringtest.MainActivity",
- false /*updateReferences*/,
- "NewActivityName",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename compilation unit 'MainActivity.java' to 'NewActivityName.java'");
- }
-
- public void testRefactor2() throws Exception {
- renameType(
- TEST_PROJECT2,
- "com.example.refactoringtest.CustomView1",
- true /*updateReferences*/,
- "NewCustomViewName",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename compilation unit 'CustomView1.java' to 'NewCustomViewName.java'\n" +
- "\n" +
- "[x] attrs_custom_view.xml - /testRefactor2/res/values/attrs_custom_view.xml\n" +
- " @@ -4 +4\n" +
- " - <declare-styleable name=\"CustomView1\">\n" +
- " + <declare-styleable name=\"NewCustomViewName\">\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2/res/layout/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <com.example.refactoringtest.NewCustomViewName\n" +
- "\n" +
- "\n" +
- "[x] customviews.xml - /testRefactor2/res/layout-land/customviews.xml\n" +
- " @@ -9 +9\n" +
- " - <com.example.refactoringtest.CustomView1\n" +
- " + <com.example.refactoringtest.NewCustomViewName");
- }
-
- public void testRefactorFragment() throws Exception {
- renameType(
- TEST_PROJECT2,
- "com.example.refactoringtest.MyFragment",
- true /*updateReferences*/,
- "NewFragmentName",
-
- "CHANGES:\n" +
- "-------\n" +
- "[x] Rename compilation unit 'MyFragment.java' to 'NewFragmentName.java'\n" +
- "\n" +
- "[x] activity_main.xml - /testRefactorFragment/res/layout/activity_main.xml\n" +
- " @@ -33 +33\n" +
- " - <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
- " + <fragment android:name=\"com.example.refactoringtest.NewFragmentName\"/>");
- }
-
- // ---- Test infrastructure ----
-
- protected void renameType(
- @NonNull Object[] testData,
- @NonNull String typeFqcn,
- boolean updateReferences,
- @NonNull String newName,
- @NonNull String expected) throws Exception {
- IProject project = createProject(testData);
- IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
- assertNotNull(javaProject);
- IType type = javaProject.findType(typeFqcn);
- assertNotNull(typeFqcn, type);
- assertTrue(typeFqcn, type.exists());
- RenameTypeProcessor processor = new RenameTypeProcessor(type);
- processor.setNewElementName(newName);
- processor.setUpdateQualifiedNames(true);
- processor.setUpdateSimilarDeclarations(false);
- //processor.setMatchStrategy(?);
- //processor.setFilePatterns(patterns);
- processor.setUpdateReferences(updateReferences);
- assertNotNull(processor);
-
- RenameRefactoring refactoring = new RenameRefactoring(processor);
- checkRefactoring(refactoring, expected);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java
deleted file mode 100644
index e00a44b32..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.common.resources.ResourceUrl;
-import com.android.resources.ResourceType;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class RenameResourceXmlTextActionTest extends TestCase {
- public void test_Simple() throws Exception {
- checkWord("^foo", null);
- checkWord("'foo'^", null);
- checkWord("^@bogus", null);
- checkWord("@bo^gus", null);
- checkWord("bogus@^", null);
- checkWord(" @string/nam^e ", getUrl(ResourceType.STRING, "name"));
- checkWord("@string/nam^e ", getUrl(ResourceType.STRING, "name"));
- checkWord("\"^@string/name ", getUrl(ResourceType.STRING, "name"));
- checkWord("^@string/name ", getUrl(ResourceType.STRING, "name"));
- checkWord("\n^@string/name ", getUrl(ResourceType.STRING, "name"));
- checkWord("\n^@string/name(", getUrl(ResourceType.STRING, "name"));
- checkWord("\n^@string/name;", getUrl(ResourceType.STRING, "name"));
- checkWord("\n^@string/name5", getUrl(ResourceType.STRING, "name5"));
- checkWord("\n@string/name5^", getUrl(ResourceType.STRING, "name5"));
- checkWord("\n@string/name5^(", getUrl(ResourceType.STRING, "name5"));
- checkWord("\n@stri^ng/name5(", getUrl(ResourceType.STRING, "name5"));
- checkWord("\n@string^/name5(", getUrl(ResourceType.STRING, "name5"));
- checkWord("\n@string/^name5(", getUrl(ResourceType.STRING, "name5"));
- checkWord("\n@string^name5(", null);
- checkWord("\n@strings^/name5(", null);
- checkWord("\n@+id/^myid(", getUrl(ResourceType.ID, "myid"));
- checkWord("\n?a^ttr/foo\"", getUrl(ResourceType.ATTR, "foo"));
- checkWord("\n?f^oo\"", getUrl(ResourceType.ATTR, "foo"));
- checkWord("\n^?foo\"", getUrl(ResourceType.ATTR, "foo"));
- }
-
- private static ResourceUrl getUrl(ResourceType type, String name) {
- return ResourceUrl.create(type, name, false, false);
- }
-
- public void testClassNames() throws Exception {
- checkClassName("^foo", null);
- checkClassName("<^foo>", null);
- checkClassName("'foo.bar.Baz'^", null);
- checkClassName("<^foo.bar.Baz ", "foo.bar.Baz");
- checkClassName("<^foo.bar.Baz>", "foo.bar.Baz");
- checkClassName("<foo.^bar.Baz>", "foo.bar.Baz");
- checkClassName("<foo.bar.Baz^>", "foo.bar.Baz");
- checkClassName("<foo.bar.Baz^ >", "foo.bar.Baz");
- checkClassName("<foo.bar$Baz^ >", "foo.bar.Baz");
- checkClassName("</^foo.bar.Baz>", "foo.bar.Baz");
- checkClassName("</foo.^bar.Baz>", "foo.bar.Baz");
-
- checkClassName("\"^foo.bar.Baz\"", "foo.bar.Baz");
- checkClassName("\"foo.^bar.Baz\"", "foo.bar.Baz");
- checkClassName("\"foo.bar.Baz^\"", "foo.bar.Baz");
- checkClassName("\"foo.bar$Baz^\"", "foo.bar.Baz");
-
- checkClassName("<foo.^bar@Baz>", null);
- }
-
- private void checkClassName(String contents, String expectedClassName)
- throws Exception {
- int cursor = contents.indexOf('^');
- assertTrue("Must set cursor position with ^ in " + contents, cursor != -1);
- contents = contents.substring(0, cursor) + contents.substring(cursor + 1);
- assertEquals(-1, contents.indexOf('^'));
- assertEquals(-1, contents.indexOf('['));
- assertEquals(-1, contents.indexOf(']'));
-
- IDocument document = new Document();
- document.replace(0, 0, contents);
- String className =
- RenameResourceXmlTextAction.findClassName(document, null, cursor);
- assertEquals(expectedClassName, className);
- }
-
- private void checkWord(String contents, ResourceUrl expectedResource)
- throws Exception {
- int cursor = contents.indexOf('^');
- assertTrue("Must set cursor position with ^ in " + contents, cursor != -1);
- contents = contents.substring(0, cursor) + contents.substring(cursor + 1);
- assertEquals(-1, contents.indexOf('^'));
- assertEquals(-1, contents.indexOf('['));
- assertEquals(-1, contents.indexOf(']'));
-
- IDocument document = new Document();
- document.replace(0, 0, contents);
- ResourceUrl resource = RenameResourceXmlTextAction.findResource(document, cursor);
- assertEquals(expectedResource, resource);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java
deleted file mode 100644
index de4e59101..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2011 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.resources;
-
-import com.android.ide.common.resources.ResourceDeltaKind;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.common.resources.configuration.ResourceQualifier;
-import com.android.resources.ResourceType;
-
-import org.eclipse.core.resources.IResourceDelta;
-
-import junit.framework.TestCase;
-
-
-/**
- * Test ResourceHelper
- */
-@SuppressWarnings("javadoc")
-public class ResourceHelperTest extends TestCase {
-
- /**
- * temp fake qualifier class.
- */
- private static class FakeQualifierClass extends ResourceQualifier {
-
- @Override
- public boolean checkAndSet(String value, FolderConfiguration config) {
- return false;
- }
-
- @Override
- public boolean equals(Object object) {
- return false;
- }
-
- @Override
- public String getFolderSegment() {
- return null;
- }
-
- @Override
- public String getLongDisplayValue() {
- return null;
- }
-
- @Override
- public String getName() {
- return null;
- }
-
- @Override
- public String getShortDisplayValue() {
- return null;
- }
-
- @Override
- public String getShortName() {
- return null;
- }
-
- @Override
- public boolean hasFakeValue() {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public boolean isValid() {
- return false;
- }
-
- @Override
- public int since() {
- return 0;
- }
- }
-
- public void testGetIcon() throws Exception {
- // check that the method returns null for an unknown qualifier class
- assertNull(ResourceHelper.getIcon(FakeQualifierClass.class));
-
- // find all the qualifiers through FolderConfiguration.createdefault()
- FolderConfiguration config = new FolderConfiguration();
- config.createDefault();
- final int count = FolderConfiguration.getQualifierCount();
- for (int i = 0 ; i < count ; i++) {
- ResourceQualifier qual = config.getQualifier(i);
- assertNotNull(qual);
- assertNotNull(qual.getClass().getCanonicalName(),
- ResourceHelper.getIcon(qual.getClass()));
- }
- }
-
- public void testGetResourceDeltaKind() {
- assertEquals(ResourceDeltaKind.ADDED,
- ResourceHelper.getResourceDeltaKind(IResourceDelta.ADDED));
- assertEquals(ResourceDeltaKind.REMOVED,
- ResourceHelper.getResourceDeltaKind(IResourceDelta.REMOVED));
- assertEquals(ResourceDeltaKind.CHANGED,
- ResourceHelper.getResourceDeltaKind(IResourceDelta.CHANGED));
-
- assertNull(ResourceHelper.getResourceDeltaKind(IResourceDelta.ADDED_PHANTOM));
- }
-
- public void testIsFileBasedResourceType() throws Exception {
- assertTrue(ResourceHelper.isFileBasedResourceType(ResourceType.ANIMATOR));
- assertTrue(ResourceHelper.isFileBasedResourceType(ResourceType.LAYOUT));
-
- assertFalse(ResourceHelper.isFileBasedResourceType(ResourceType.STRING));
- assertFalse(ResourceHelper.isFileBasedResourceType(ResourceType.DIMEN));
- assertFalse(ResourceHelper.isFileBasedResourceType(ResourceType.ID));
-
- // Both:
- assertTrue(ResourceHelper.isFileBasedResourceType(ResourceType.DRAWABLE));
- assertTrue(ResourceHelper.isFileBasedResourceType(ResourceType.COLOR));
- }
-
- public void testIsValueBasedResourceType() throws Exception {
- assertTrue(ResourceHelper.isValueBasedResourceType(ResourceType.STRING));
- assertTrue(ResourceHelper.isValueBasedResourceType(ResourceType.DIMEN));
- assertTrue(ResourceHelper.isValueBasedResourceType(ResourceType.ID));
-
- assertFalse(ResourceHelper.isValueBasedResourceType(ResourceType.LAYOUT));
-
- // These can be both:
- assertTrue(ResourceHelper.isValueBasedResourceType(ResourceType.DRAWABLE));
- assertTrue(ResourceHelper.isValueBasedResourceType(ResourceType.COLOR));
- }
-
- public void testCanCreateResource() throws Exception {
- assertTrue(ResourceHelper.canCreateResource("@layout/foo"));
- assertTrue(ResourceHelper.canCreateResource("@string/foo"));
- assertTrue(ResourceHelper.canCreateResource("@dimen/foo"));
- assertTrue(ResourceHelper.canCreateResource("@color/foo"));
-
- assertFalse(ResourceHelper.canCreateResource("@typo/foo")); // nonexistent type
- assertFalse(ResourceHelper.canCreateResource("@layout/foo bar")); // space
- assertFalse(ResourceHelper.canCreateResource("@layout/new")); // keyword
- assertFalse(ResourceHelper.canCreateResource("@android:string/foo")); // framework
- assertFalse(ResourceHelper.canCreateResource("@android:dimen/foo"));
- assertFalse(ResourceHelper.canCreateResource("@android:color/foo"));
- }
-
- public void testCanCreateResourceType() throws Exception {
- assertTrue(ResourceHelper.canCreateResourceType(ResourceType.LAYOUT));
- assertTrue(ResourceHelper.canCreateResourceType(ResourceType.STRING));
- assertTrue(ResourceHelper.canCreateResourceType(ResourceType.DIMEN));
- assertTrue(ResourceHelper.canCreateResourceType(ResourceType.COLOR));
-
- assertFalse(ResourceHelper.canCreateResourceType(ResourceType.RAW));
- assertFalse(ResourceHelper.canCreateResourceType(ResourceType.XML));
- }
-
- public void testStyleToTheme() throws Exception {
- assertEquals("Foo", ResourceHelper.styleToTheme("Foo"));
- assertEquals("Theme", ResourceHelper.styleToTheme("@android:style/Theme"));
- assertEquals("LocalTheme", ResourceHelper.styleToTheme("@style/LocalTheme"));
- //assertEquals("LocalTheme", ResourceHelper.styleToTheme("@foo.bar:style/LocalTheme"));
- }
-
- public void testIsProjectStyle() throws Exception {
- assertFalse(ResourceHelper.isProjectStyle("@android:style/Theme"));
- assertTrue(ResourceHelper.isProjectStyle("@style/LocalTheme"));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidatorTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidatorTest.java
deleted file mode 100644
index 2cc2c932c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceNameValidatorTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ResourceType;
-
-import org.eclipse.core.resources.IProject;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class ResourceNameValidatorTest extends TestCase {
- public void testValidator() throws Exception {
- // Valid
- ResourceNameValidator validator = ResourceNameValidator.create(true,
- ResourceFolderType.VALUES);
- assertTrue(validator.isValid("foo") == null);
- assertTrue(validator.isValid("foo.xml") == null);
- assertTrue(validator.isValid("Foo123_$") == null);
- assertTrue(validator.isValid("foo.xm") == null); // For non-file types, . => _
-
- // Invalid
- assertTrue(validator.isValid("") != null);
- assertTrue(validator.isValid(" ") != null);
- assertTrue(validator.isValid("foo bar") != null);
- assertTrue(validator.isValid("1foo") != null);
- assertTrue(validator.isValid("foo%bar") != null);
- assertTrue(ResourceNameValidator.create(true, Collections.singleton("foo"),
- ResourceType.STRING).isValid("foo") != null);
- assertTrue(ResourceNameValidator.create(true,
- ResourceFolderType.DRAWABLE).isValid("foo.xm") != null);
- assertTrue(ResourceNameValidator.create(false,
- ResourceFolderType.DRAWABLE).isValid("foo.xm") != null);
-
- // Only lowercase chars allowed in file-based resource names
- assertTrue(ResourceNameValidator.create(true, ResourceFolderType.LAYOUT)
- .isValid("Foo123_$") != null);
- assertTrue(ResourceNameValidator.create(true, ResourceFolderType.LAYOUT)
- .isValid("foo123_") == null);
-
- // Can't start with _ in file-based resource names, is okay for value based resources
- assertTrue(ResourceNameValidator.create(true, ResourceFolderType.VALUES)
- .isValid("_foo") == null);
- assertTrue(ResourceNameValidator.create(true, ResourceFolderType.LAYOUT)
- .isValid("_foo") != null);
- assertTrue(ResourceNameValidator.create(true, ResourceFolderType.DRAWABLE)
- .isValid("_foo") != null);
- }
-
- public void testIds() throws Exception {
- ResourceNameValidator validator = ResourceNameValidator.create(false, (IProject) null,
- ResourceType.ID);
- assertTrue(validator.isValid("foo") == null);
- assertTrue(validator.isValid(" foo") != null);
- assertTrue(validator.isValid("foo ") != null);
- assertTrue(validator.isValid("foo@") != null);
- }
-
- public void testUniqueOrExists() throws Exception {
- Set<String> existing = new HashSet<String>();
- existing.add("foo1");
- existing.add("foo2");
- existing.add("foo3");
-
- ResourceNameValidator validator = ResourceNameValidator.create(true, existing,
- ResourceType.ID);
- validator.unique();
-
- assertNull(validator.isValid("foo")); // null: ok (no error message)
- assertNull(validator.isValid("foo4"));
- assertNotNull(validator.isValid("foo1"));
- assertNotNull(validator.isValid("foo2"));
- assertNotNull(validator.isValid("foo3"));
-
- validator.exist();
- assertNotNull(validator.isValid("foo"));
- assertNotNull(validator.isValid("foo4"));
- assertNull(validator.isValid("foo1"));
- assertNull(validator.isValid("foo2"));
- assertNull(validator.isValid("foo3"));
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContextTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContextTest.java
deleted file mode 100644
index 3104c8593..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/manager/IdeScanningContextTest.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.resources.manager;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class IdeScanningContextTest extends TestCase {
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java
deleted file mode 100644
index 5f7de429b..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoaderTest.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdk;
-
-import com.android.ide.eclipse.adt.internal.sdk.AndroidJarLoader;
-import com.android.ide.eclipse.adt.internal.sdk.IAndroidClassLoader.IClassDescriptor;
-import com.android.ide.eclipse.tests.AdtTestData;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-/**
- * Unit Test for {@link AndroidJarLoader}.
- *
- * Uses the classes jar.example.Class1/Class2 stored in tests/data/jar_example.jar.
- */
-public class AndroidJarLoaderTest extends TestCase {
-
- private AndroidJarLoader mFrameworkClassLoader;
-
- /** Creates an instance of {@link AndroidJarLoader} on our test data JAR */
- @Override
- public void setUp() throws Exception {
- String jarfilePath = AdtTestData.getInstance().getTestFilePath(
- "com/android/ide/eclipse/testdata/jar_example.jar"); //$NON-NLS-1$
- mFrameworkClassLoader = new AndroidJarLoader(jarfilePath);
- }
-
- @Override
- public void tearDown() throws Exception {
- mFrameworkClassLoader = null;
- System.gc();
- }
-
- /** Preloads classes. They should load just fine. */
- public final void testPreLoadClasses() throws Exception {
- mFrameworkClassLoader.preLoadClasses("jar.example.", null, null); //$NON-NLS-1$
- HashMap<String, Class<?>> map = getPrivateClassCache();
- assertEquals(0, map.size());
- HashMap<String,byte[]> data = getPrivateEntryCache();
- assertTrue(data.containsKey("jar.example.Class1")); //$NON-NLS-1$
- assertTrue(data.containsKey("jar.example.Class2")); //$NON-NLS-1$
- assertTrue(data.containsKey("jar.example.Class1$InnerStaticClass1")); //$NON-NLS-1$
- assertTrue(data.containsKey("jar.example.Class1$InnerClass2")); //$NON-NLS-1$
- assertEquals(4, data.size());
- }
-
- /** Preloads a class not in the JAR. Preloading does nothing in this case. */
- public final void testPreLoadClasses_classNotFound() throws Exception {
- mFrameworkClassLoader.preLoadClasses("not.a.package.", null, null); //$NON-NLS-1$
- HashMap<String, Class<?>> map = getPrivateClassCache();
- assertEquals(0, map.size());
- HashMap<String,byte[]> data = getPrivateEntryCache();
- assertEquals(0, data.size());
- }
-
- /** Finds a class we just preloaded. It should work. */
- public final void testFindClass_classFound() throws Exception {
- Class<?> c = _findClass(mFrameworkClassLoader, "jar.example.Class2"); //$NON-NLS-1$
- assertEquals("jar.example.Class2", c.getName()); //$NON-NLS-1$
- HashMap<String, Class<?>> map = getPrivateClassCache();
- assertTrue(map.containsKey("jar.example.Class1")); //$NON-NLS-1$
- assertTrue(map.containsKey("jar.example.Class2")); //$NON-NLS-1$
- assertEquals(2, map.size());
- }
-
- /** call the protected method findClass */
- private Class<?> _findClass(AndroidJarLoader jarLoader, String name) throws Exception {
- Method findClassMethod = AndroidJarLoader.class.getDeclaredMethod(
- "findClass", String.class); //$NON-NLS-1$
- findClassMethod.setAccessible(true);
- try {
- return (Class<?>)findClassMethod.invoke(jarLoader, name);
- }
- catch (InvocationTargetException e) {
- throw (Exception)e.getCause();
- }
- }
-
- /** Trying to find a class that we fail to preload should throw a CNFE. */
- public final void testFindClass_classNotFound() throws Exception {
- try {
- // Will throw ClassNotFoundException
- _findClass(mFrameworkClassLoader, "not.a.valid.ClassName"); //$NON-NLS-1$
- } catch (ClassNotFoundException e) {
- // check the message in the CNFE
- assertEquals("not.a.valid.ClassName", e.getMessage()); //$NON-NLS-1$
- return;
- }
- // Exception not thrown - this is a failure
- fail("Expected ClassNotFoundException not thrown");
- }
-
- public final void testFindClassesDerivingFrom() throws Exception {
- HashMap<String, ArrayList<IClassDescriptor>> found =
- mFrameworkClassLoader.findClassesDerivingFrom("jar.example.", new String[] { //$NON-NLS-1$
- "jar.example.Class1", //$NON-NLS-1$
- "jar.example.Class2" }); //$NON-NLS-1$
-
- assertTrue(found.containsKey("jar.example.Class1")); //$NON-NLS-1$
- assertTrue(found.containsKey("jar.example.Class2")); //$NON-NLS-1$
- assertEquals(2, found.size());
- // Only Class2 derives from Class1..
- // Class1 and Class1$InnerStaticClass1 derive from Object and are thus ignored.
- // Class1$InnerClass2 should never be seen either.
- assertEquals("jar.example.Class2", //$NON-NLS-1$
- found.get("jar.example.Class1").get(0).getFullClassName()); //$NON-NLS-1$
- assertEquals(1, found.get("jar.example.Class1").size()); //$NON-NLS-1$
- assertEquals(0, found.get("jar.example.Class2").size()); //$NON-NLS-1$
- }
-
- // --- Utilities ---
-
- /**
- * Retrieves the private mFrameworkClassLoader.mClassCache field using reflection.
- *
- * @throws NoSuchFieldException
- * @throws SecurityException
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- */
- @SuppressWarnings("unchecked")
- private HashMap<String, Class<?> > getPrivateClassCache()
- throws SecurityException, NoSuchFieldException,
- IllegalArgumentException, IllegalAccessException {
- Field field = AndroidJarLoader.class.getDeclaredField("mClassCache"); //$NON-NLS-1$
- field.setAccessible(true);
- return (HashMap<String, Class<?>>) field.get(mFrameworkClassLoader);
- }
-
- /**
- * Retrieves the private mFrameworkClassLoader.mEntryCache field using reflection.
- *
- * @throws NoSuchFieldException
- * @throws SecurityException
- * @throws IllegalAccessException
- * @throws IllegalArgumentException
- */
- @SuppressWarnings("unchecked")
- private HashMap<String,byte[]> getPrivateEntryCache()
- throws SecurityException, NoSuchFieldException,
- IllegalArgumentException, IllegalAccessException {
- Field field = AndroidJarLoader.class.getDeclaredField("mEntryCache"); //$NON-NLS-1$
- field.setAccessible(true);
- return (HashMap<String, byte[]>) field.get(mFrameworkClassLoader);
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java
deleted file mode 100644
index c89dd0649..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/sdk/LayoutParamsParserTest.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdk;
-
-import com.android.ide.common.resources.platform.AttrsXmlParser;
-import com.android.ide.common.resources.platform.ViewClassInfo;
-import com.android.ide.common.resources.platform.ViewClassInfo.LayoutParamsInfo;
-import com.android.ide.eclipse.adt.internal.sdk.AndroidJarLoader.ClassWrapper;
-import com.android.ide.eclipse.adt.internal.sdk.IAndroidClassLoader.IClassDescriptor;
-import com.android.ide.eclipse.mock.TestLogger;
-import com.android.ide.eclipse.tests.AdtTestData;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.TreeMap;
-
-import junit.framework.TestCase;
-
-/**
- * Test the inner private methods of PlatformDataParser.
- *
- * Convention: method names that start with an underscore are actually local wrappers
- * that call private methods from {@link AndroidTargetParser} using reflection.
- * This is inspired by the Python coding rule which mandates underscores prefixes for
- * "private" methods.
- */
-public class LayoutParamsParserTest extends TestCase {
-
- private static final String MOCK_DATA_PATH =
- "com/android/ide/eclipse/testdata/mock_attrs.xml"; //$NON-NLS-1$
-
- private static class MockFrameworkClassLoader extends AndroidJarLoader {
- MockFrameworkClassLoader() {
- super(null /* osFrameworkLocation */);
- }
-
- @Override
- public HashMap<String, ArrayList<IClassDescriptor>> findClassesDerivingFrom(
- String rootPackage, String[] superClasses) throws ClassFormatError {
- return new HashMap<String, ArrayList<IClassDescriptor>>();
- }
- }
-
- private static class MockLayoutParamsParser extends LayoutParamsParser {
- public MockLayoutParamsParser() {
- super(new MockFrameworkClassLoader(),
- new AttrsXmlParser(
- AdtTestData.getInstance().getTestFilePath(MOCK_DATA_PATH),
- new TestLogger(), 100).preload());
-
- mTopViewClass = new ClassWrapper(mock_android.view.View.class);
- mTopGroupClass = new ClassWrapper(mock_android.view.ViewGroup.class);
- mTopLayoutParamsClass = new ClassWrapper(mock_android.view.ViewGroup.LayoutParams.class);
-
- mViewList = new ArrayList<IClassDescriptor>();
- mGroupList = new ArrayList<IClassDescriptor>();
- mViewMap = new TreeMap<String, ExtViewClassInfo>();
- mGroupMap = new TreeMap<String, ExtViewClassInfo>();
- mLayoutParamsMap = new HashMap<String, LayoutParamsInfo>();
- }
- }
-
- private MockLayoutParamsParser mParser;
-
- @Override
- public void setUp() throws Exception {
- mParser = new MockLayoutParamsParser();
- }
-
- @Override
- public void tearDown() throws Exception {
- }
-
- public final void testFindLayoutParams() throws Exception {
- assertEquals(mock_android.view.ViewGroup.LayoutParams.class,
- ((ClassWrapper)_findLayoutParams(mock_android.view.ViewGroup.class)).wrappedClass());
-
- assertEquals(mock_android.widget.LinearLayout.LayoutParams.class,
- ((ClassWrapper)_findLayoutParams(mock_android.widget.LinearLayout.class)).wrappedClass());
-
- assertEquals(mock_android.widget.TableLayout.LayoutParams.class,
- ((ClassWrapper)_findLayoutParams(mock_android.widget.TableLayout.class)).wrappedClass());
- }
-
- public final void testGetLayoutParamsInfo() throws Exception {
- LayoutParamsInfo info1 = _getLayoutParamsInfo(
- mock_android.view.ViewGroup.LayoutParams.class);
- assertNotNull(info1);
- // ViewGroup.LayoutData has Object for superClass, which we don't map
- assertNull(info1.getSuperClass());
-
- LayoutParamsInfo info2 = _getLayoutParamsInfo(
- mock_android.widget.LinearLayout.LayoutParams.class);
- assertNotNull(info2);
- // LinearLayout.LayoutData links to ViewGroup.LayoutParams
- assertSame(info1, info2.getSuperClass());
-
- LayoutParamsInfo info3 = _getLayoutParamsInfo(
- mock_android.widget.TableLayout.LayoutParams.class);
- assertNotNull(info3);
- // TableLayout.LayoutData does not link to ViewGroup.LayoutParams nor
- // LinearLayout.LayoutParams
- assertNotSame(info1, info3.getSuperClass());
- assertNotSame(info2, info3.getSuperClass());
- // TableLayout.LayoutParams => ViewGroup.MarginLayoutParams => ViewGroup.LayoutParams
- assertSame(info1, info3.getSuperClass().getSuperClass());
- }
-
- public final void testGetLayoutClasses() throws Exception {
- // _getLayoutClasses();
- }
-
- //---- access to private methods
-
- /** Calls the private constructor of the parser */
- @SuppressWarnings("unused")
- private AndroidTargetParser _Constructor(String osJarPath) throws Exception {
- Constructor<AndroidTargetParser> constructor =
- AndroidTargetParser.class.getDeclaredConstructor(String.class);
- constructor.setAccessible(true);
- return constructor.newInstance(osJarPath);
- }
-
- /** calls the private getLayoutClasses() of the parser */
- @SuppressWarnings("unused")
- private void _getLayoutClasses() throws Exception {
- Method method = AndroidTargetParser.class.getDeclaredMethod("getLayoutClasses"); //$NON-NLS-1$
- method.setAccessible(true);
- method.invoke(mParser);
- }
-
- /** calls the private addGroup() of the parser */
- @SuppressWarnings("unused")
- private ViewClassInfo _addGroup(Class<?> groupClass) throws Exception {
- Method method = LayoutParamsParser.class.getDeclaredMethod("addGroup", //$NON-NLS-1$
- IClassDescriptor.class);
- method.setAccessible(true);
- return (ViewClassInfo) method.invoke(mParser, new ClassWrapper(groupClass));
- }
-
- /** calls the private addLayoutParams() of the parser */
- @SuppressWarnings("unused")
- private LayoutParamsInfo _addLayoutParams(Class<?> groupClass) throws Exception {
- Method method = LayoutParamsParser.class.getDeclaredMethod("addLayoutParams", //$NON-NLS-1$
- IClassDescriptor.class);
- method.setAccessible(true);
- return (LayoutParamsInfo) method.invoke(mParser, new ClassWrapper(groupClass));
- }
-
- /** calls the private getLayoutParamsInfo() of the parser */
- private LayoutParamsInfo _getLayoutParamsInfo(Class<?> layoutParamsClass) throws Exception {
- Method method = LayoutParamsParser.class.getDeclaredMethod("getLayoutParamsInfo", //$NON-NLS-1$
- IClassDescriptor.class);
- method.setAccessible(true);
- return (LayoutParamsInfo) method.invoke(mParser, new ClassWrapper(layoutParamsClass));
- }
-
- /** calls the private findLayoutParams() of the parser */
- private IClassDescriptor _findLayoutParams(Class<?> groupClass) throws Exception {
- Method method = LayoutParamsParser.class.getDeclaredMethod("findLayoutParams", //$NON-NLS-1$
- IClassDescriptor.class);
- method.setAccessible(true);
- return (IClassDescriptor) method.invoke(mParser, new ClassWrapper(groupClass));
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmActivityToLayoutMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmActivityToLayoutMethodTest.java
deleted file mode 100644
index 9caeab25e..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmActivityToLayoutMethodTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmActivityToLayoutMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmActivityToLayoutMethod method = new FmActivityToLayoutMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("FooActivity", "activity_foo");
- }
-
- public void test2() throws Exception {
- check("FooActiv", "activity_foo");
- }
-
- public void test3() throws Exception {
- check("Foo", "activity_foo");
- }
-
- public void test4() throws Exception {
- check("", "");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmCamelCaseToUnderscoreMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmCamelCaseToUnderscoreMethodTest.java
deleted file mode 100644
index dee0ce6bf..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmCamelCaseToUnderscoreMethodTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmCamelCaseToUnderscoreMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmCamelCaseToUnderscoreMethod method = new FmCamelCaseToUnderscoreMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("foo", "foo");
- }
-
- public void test3() throws Exception {
- check("Foo", "foo");
- }
-
- public void test4() throws Exception {
- check("FooBar", "foo_bar");
- }
-
- public void test5() throws Exception {
- check("testXML", "test_xml");
- }
-
- public void test6() throws Exception {
- check("testFoo", "test_foo");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmClassNameToResourceMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmClassNameToResourceMethodTest.java
deleted file mode 100644
index ff90ea0ed..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmClassNameToResourceMethodTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmClassNameToResourceMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmClassNameToResourceMethod method = new FmClassNameToResourceMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("FooActivity", "foo");
- }
-
- public void test2() throws Exception {
- check("FooActiv", "foo");
- }
-
- public void test3() throws Exception {
- check("Foo", "foo");
- }
-
- public void test4() throws Exception {
- check("", "");
- }
-
- public void test5() throws Exception {
- check("FooFragment", "foo");
- }
-
- public void test6() throws Exception {
- check("FooService", "foo");
- }
-
- public void test7() throws Exception {
- check("FooProvider", "foo");
- }
-
- public void test8() throws Exception {
- check("FooBar", "foo_bar");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlAttributeMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlAttributeMethodTest.java
deleted file mode 100644
index eb1e94940..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlAttributeMethodTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmEscapeXmlAttributeMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmEscapeXmlAttributeMethod method = new FmEscapeXmlAttributeMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("foo", "foo");
- }
-
- public void test3() throws Exception {
- check("<\"'>&", "&lt;&quot;&apos;>&amp;");
- }
-
- public void test4() throws Exception {
- check("foo>bar", "foo>bar");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethodTest.java
deleted file mode 100644
index 1a4289a03..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethodTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmEscapeXmlStringMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmEscapeXmlStringMethod method = new FmEscapeXmlStringMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("foo", "foo");
- }
-
- public void test3() throws Exception {
- check(" Foo Bar ", "\" Foo Bar \"");
- }
-
- public void test4() throws Exception {
- check("@foo", "\\@foo");
- }
-
- public void test5() throws Exception {
- check("Hello\nWorld", "Hello\\nWorld");
- }
-
- public void test6() throws Exception {
- check("A & B", "A &amp; B");
- }
-
- public void test7() throws Exception {
- check("Foo's Bar", "Foo\\'s Bar");
- }
-
- public void test8() throws Exception {
- check("'\"\\", "\\'\\\"\\\\");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlTextMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlTextMethodTest.java
deleted file mode 100644
index c08b834e9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlTextMethodTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmEscapeXmlTextMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmEscapeXmlTextMethod method = new FmEscapeXmlTextMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("foo", "foo");
- }
-
- public void test3() throws Exception {
- check("<\"'>&", "&lt;\"'>&amp;");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmExtractLettersMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmExtractLettersMethodTest.java
deleted file mode 100644
index b1d3cee13..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmExtractLettersMethodTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmExtractLettersMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmExtractLettersMethod method = new FmExtractLettersMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("foo", "foo");
- }
-
- public void test3() throws Exception {
- check("<\"'>&foo ", "foo");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmLayoutToActivityMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmLayoutToActivityMethodTest.java
deleted file mode 100644
index af0a1dbf5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmLayoutToActivityMethodTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmLayoutToActivityMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmLayoutToActivityMethod method = new FmLayoutToActivityMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("foo", "FooActivity");
- }
-
- public void test2() throws Exception {
- check("activity_foo", "FooActivity");
- }
-
- public void test3() throws Exception {
- check("activity_", "MyActivity");
- }
-
- public void test4() throws Exception {
- check("activ", "ActivActivity");
- }
-
- public void test5() throws Exception {
- check("", "MyActivity");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmSlashedPackageNameMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmSlashedPackageNameMethodTest.java
deleted file mode 100644
index 439110237..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmSlashedPackageNameMethodTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmSlashedPackageNameMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmSlashedPackageNameMethod method = new FmSlashedPackageNameMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("foo", "foo");
- }
-
- public void test3() throws Exception {
- check("foo.bar.baz", "foo/bar/baz");
- }
-
- public void test4() throws Exception {
- check("foo/bar/baz", "foo/bar/baz");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmUnderscoreToCamelCaseMethodTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmUnderscoreToCamelCaseMethodTest.java
deleted file mode 100644
index 4955dae79..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/wizards/templates/FmUnderscoreToCamelCaseMethodTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.wizards.templates;
-
-import freemarker.template.SimpleScalar;
-import freemarker.template.TemplateModelException;
-
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class FmUnderscoreToCamelCaseMethodTest extends TestCase {
- @SuppressWarnings("rawtypes")
- private void check(String s, String expected) throws TemplateModelException {
- FmUnderscoreToCamelCaseMethod method = new FmUnderscoreToCamelCaseMethod();
- List list = Collections.singletonList(new SimpleScalar(s));
- assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
- }
-
- public void test1() throws Exception {
- check("", "");
- }
-
- public void test2() throws Exception {
- check("_", "");
- }
-
- public void test3() throws Exception {
- check("foo", "Foo");
- }
-
- public void test4() throws Exception {
- check("foo_bar", "FooBar");
- }
-
- public void test5() throws Exception {
- check("foo__bar", "FooBar");
- }
-
- public void test6() throws Exception {
- check("foo_", "Foo");
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java
deleted file mode 100644
index 65e2144be..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2010 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.mock;
-
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.isA;
-import static org.easymock.EasyMock.replay;
-
-import com.android.io.IAbstractFolder;
-import com.android.io.IAbstractResource;
-
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-
-import java.util.Map;
-
-public class Mocks {
- public static IJavaProject createProject(IClasspathEntry[] entries, IPath outputLocation)
- throws Exception {
- IJavaProject javaProject = createMock(IJavaProject.class);
- final Capture<IClasspathEntry[]> capturedEntries = new Capture<IClasspathEntry[]>();
- Capture<IPath> capturedOutput = new Capture<IPath>();
- capturedEntries.setValue(entries);
- capturedOutput.setValue(outputLocation);
-
- IProject project = createProject();
- expect(javaProject.getProject()).andReturn(project).anyTimes();
- expect(javaProject.getOutputLocation()).andReturn(capturedOutput.getValue()).anyTimes();
-
- expect(javaProject.getRawClasspath()).andAnswer(new IAnswer<IClasspathEntry[]>() {
- @Override
- public IClasspathEntry[] answer() throws Throwable {
- return capturedEntries.getValue();
- }
- }).anyTimes();
-
- javaProject.setRawClasspath(capture(capturedEntries), isA(IProgressMonitor.class));
- expectLastCall().anyTimes();
-
- javaProject.setRawClasspath(capture(capturedEntries), capture(capturedOutput),
- isA(IProgressMonitor.class));
- expectLastCall().anyTimes();
-
- final Capture<String> capturedCompliance = new Capture<String>();
- capturedCompliance.setValue("1.4");
- final Capture<String> capturedSource = new Capture<String>();
- capturedSource.setValue("1.4");
- final Capture<String> capturedTarget = new Capture<String>();
- capturedTarget.setValue("1.4");
-
- expect(javaProject.getOption(JavaCore.COMPILER_COMPLIANCE, true)).andAnswer(
- new IAnswer<String>() {
- @Override
- public String answer() throws Throwable {
- return capturedCompliance.getValue();
- }
- });
- expect(javaProject.getOption(JavaCore.COMPILER_SOURCE, true)).andAnswer(
- new IAnswer<String>() {
- @Override
- public String answer() throws Throwable {
- return capturedSource.getValue();
- }
- });
- expect(javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true)).andAnswer(
- new IAnswer<String>() {
- @Override
- public String answer() throws Throwable {
- return capturedTarget.getValue();
- }
- });
-
- javaProject.setOption(eq(JavaCore.COMPILER_COMPLIANCE), capture(capturedCompliance));
- expectLastCall().anyTimes();
- javaProject.setOption(eq(JavaCore.COMPILER_SOURCE), capture(capturedSource));
- expectLastCall().anyTimes();
- javaProject.setOption(eq(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM),
- capture(capturedTarget));
- expectLastCall().anyTimes();
-
- replay(javaProject);
-
- return javaProject;
- }
-
- /**
- * Creates a mock implementation of {@link IFile}.
- * <p/>
- * Supported methods:
- * <ul>
- * <li>IFile#getName()</li>
- * <li>IFile#getLocation()</li>
- * </ul>
- */
- public static IFile createFile(String fileName) {
- IFile file = createNiceMock(IFile.class);
- expect(file.getName()).andReturn(fileName).anyTimes();
- expect(file.getLocation()).andReturn(new Path(fileName)).anyTimes();
- replay(file);
- return file;
- }
-
- /**
- * Creates a mock implementation of {@link IFolder}.
- * <p/>
- * Supported methods:
- * <ul>
- * <li>{@link IFolder#getName()}</li>
- * <li>{@link IFolder#members()}</li>
- * </ul>
- */
- public static IFolder createFolder(String name, IResource[] members) throws Exception {
- IFolder file = createNiceMock(IFolder.class);
- expect(file.getName()).andReturn(name).anyTimes();
- // expect(file.getLocation()).andReturn(new Path(name)).anyTimes();
- expect(file.members()).andReturn(members).anyTimes();
- replay(file);
- return file;
- }
-
- public static IAbstractFolder createAbstractFolder(String name, IAbstractResource[] members) {
- IAbstractFolder folder = createNiceMock(IAbstractFolder.class);
- expect(folder.getName()).andReturn(name).anyTimes();
- // expect(file.getLocation()).andReturn(new Path(name)).anyTimes();
- expect(folder.listMembers()).andReturn(members).anyTimes();
- replay(folder);
-
- return folder;
- }
-
- /**
- * Mock implementation of {@link IProject}.
- * <p/>
- * Supported methods:
- * <ul>
- * <li>{@link IProject#build(int kind, IProgressMonitor monitor)}</li>
- * <li>
- * {@link IProject#build(int kind, String builderName, Map args, IProgressMonitor monitor)}
- * </li>
- * </ul>
- */
- public static IProject createProject() {
- IProject project = EasyMock.createNiceMock(IProject.class);
- replay(project);
- return project;
- }
-
- /**
- * Creates a mock implementation of an {@link IClasspathEntry}, which supports
- * {@link IClasspathEntry#getEntryKind} and {@link IClasspathEntry#getPath}.
- */
- public static IClasspathEntry createClasspathEntry(IPath path, int kind) {
- IClasspathEntry entry = createNiceMock(IClasspathEntry.class);
- expect(entry.getEntryKind()).andReturn(kind).anyTimes();
- expect(entry.getPath()).andReturn(path).anyTimes();
- replay(entry);
- return entry;
- }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java
deleted file mode 100644
index f8bf4b31a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/TestLogger.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2010 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.mock;
-
-
-import com.android.utils.ILogger;
-
-import junit.framework.Assert;
-
-/**
- * Implementation of {@link ILogger} suitable for test use; will fail the current test if
- * {@link #error} is called, and prints everything else to standard error.
- */
-public class TestLogger implements ILogger {
-
- @Override
- public void error(Throwable t, String errorFormat, Object... args) {
- String message = String.format(errorFormat, args);
- if (t != null) {
- message = t.toString() + ":" + message; //$NON-NLS-1$
- }
- Assert.fail(message);
- }
-
- @Override
- public void info(String msgFormat, Object... args) {
- System.out.println(String.format(msgFormat, args));
- }
-
- @Override
- public void verbose(String msgFormat, Object... args) {
- info(msgFormat, args);
- }
-
- @Override
- public void warning(String warningFormat, Object... args) {
- System.err.println(String.format(warningFormat, args));
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-one-dot.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-one-dot.9.png
deleted file mode 100644
index 690d76efc..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-one-dot.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-two-dots.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-two-dots.9.png
deleted file mode 100644
index c3d3e4c29..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area-two-dots.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area.9.png
deleted file mode 100644
index 6a7a62c59..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/content-area.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched1.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched1.9.png
deleted file mode 100644
index 9e5ffbf46..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched1.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched2.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched2.9.png
deleted file mode 100644
index cfd9c1d64..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched2.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched3.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched3.9.png
deleted file mode 100644
index 0f2c3eba5..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched3.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched4.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched4.9.png
deleted file mode 100644
index ce7321032..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched4.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched5.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched5.9.png
deleted file mode 100644
index 97d9cd860..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched5.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched6.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched6.9.png
deleted file mode 100644
index f9b8a4870..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched6.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched7.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched7.9.png
deleted file mode 100644
index bbbb3ad8c..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched7.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched8.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched8.9.png
deleted file mode 100644
index 35f04b547..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/invalid-patched8.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/layout-bounds-only.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/layout-bounds-only.9.png
deleted file mode 100644
index 6f7047318..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/layout-bounds-only.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched-interlace.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched-interlace.png
deleted file mode 100644
index a6d0e94af..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched-interlace.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched.png
deleted file mode 100644
index 742b1e816..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/no-patched.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched-with-badpatches.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched-with-badpatches.9.png
deleted file mode 100644
index 1a38972cd..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched-with-badpatches.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched1.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched1.9.png
deleted file mode 100644
index 6a7a62c59..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched1.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched2.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched2.9.png
deleted file mode 100644
index 11a1a6d12..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched2.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched3.9.png b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched3.9.png
deleted file mode 100644
index 8d288c903..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/draw9patch/patched3.9.png
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar
deleted file mode 100644
index f95b59588..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jar
+++ /dev/null
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc
deleted file mode 100644
index 14cd44f5a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/jar_example.jardesc
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
-<jardesc>
- <jar path="jar_example.jar"/>
- <options buildIfNeeded="true" compress="true" descriptionLocation="/common/tests/data/jar_example.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
- <storedRefactorings deprecationInfo="true" structuralOnly="false"/>
- <selectedProjects/>
- <manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
- <sealing sealJar="false">
- <packagesToSeal/>
- <packagesToUnSeal/>
- </sealing>
- </manifest>
- <selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
- <javaElement handleIdentifier="=common/tests&lt;jar.example"/>
- </selectedElements>
-</jardesc>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml
deleted file mode 100644
index db77e1749..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_attrs.xml
+++ /dev/null
@@ -1,340 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
- <!-- WARNING !!! THIS IS A MOCK FILE. DO NOT USE FOR DOCUMENTATION PURPOSES.
- This file has been trimmed down to only extract a number of interesting cases
- for unit tests.
-
- What this contains:
- - View
- - ViewGroup
- - some attributes which format are defined in Theme
- - orientation, gravity and layout_gravity defined before they are used
- - ViewGroup_Layout
- - ViewGroup_MarginLayout
- - LinearLayout
- - LinearLayout_Layout
- - TableLayout
-
- Note that TableLayout does not have a TableLayout_Layout definition here
- where these is a class TableLayout.LayoutData.
- -->
-
- <!-- These are the standard attributes that make up a complete theme. -->
- <declare-styleable name="Theme">
-
- <!-- Defines the scrollbars size. -->
- <attr name="scrollbarSize" format="dimension" />
-
- </declare-styleable>
-
-
- <!-- Standard orientation constant. -->
- <attr name="orientation">
- <!-- Defines an horizontal widget. -->
- <enum name="horizontal" value="0" />
- <!-- Defines a vertical widget. -->
- <enum name="vertical" value="1" />
- </attr>
-
- <!-- Specifies how to place an object, both
- its x and y axis, within a larger containing object. -->
- <attr name="gravity">
- <!-- Push object to the top of its container, not changing its size. -->
- <flag name="top" value="0x30" />
- <!-- Push object to the bottom of its container, not changing its size. -->
- <flag name="bottom" value="0x50" />
- <!-- Push object to the left of its container, not changing its size. -->
- <flag name="left" value="0x03" />
- <!-- Push object to the right of its container, not changing its size. -->
- <flag name="right" value="0x05" />
- <!-- Place object in the vertical center of its container, not changing its size. -->
- <flag name="center_vertical" value="0x10" />
- <!-- Grow the vertical size of the object if needed so it completely fills its container. -->
- <flag name="fill_vertical" value="0x70" />
- <!-- Place object in the horizontal center of its container, not changing its size. -->
- <flag name="center_horizontal" value="0x01" />
- <!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
- <flag name="fill_horizontal" value="0x07" />
- <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
- <flag name="center" value="0x11" />
- <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
- <flag name="fill" value="0x77" />
- </attr>
-
- <!-- Standard gravity constant that a child can supply to its parent.
- Defines how to place an object, both
- its x and y axis, within a larger containing object. -->
- <attr name="layout_gravity">
- <!-- Push object to the top of its container, not changing its size. -->
- <flag name="top" value="0x30" />
- <!-- Push object to the bottom of its container, not changing its size. -->
- <flag name="bottom" value="0x50" />
- <!-- Push object to the left of its container, not changing its size. -->
- <flag name="left" value="0x03" />
- <!-- Push object to the right of its container, not changing its size. -->
- <flag name="right" value="0x05" />
- <!-- Place object in the vertical center of its container, not changing its size. -->
- <flag name="center_vertical" value="0x10" />
- <!-- Grow the vertical size of the object if needed so it completely fills its container. -->
- <flag name="fill_vertical" value="0x70" />
- <!-- Place object in the horizontal center of its container, not changing its size. -->
- <flag name="center_horizontal" value="0x01" />
- <!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
- <flag name="fill_horizontal" value="0x07" />
- <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
- <flag name="center" value="0x11" />
- <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
- <flag name="fill" value="0x77" />
- </attr>
-
- <declare-styleable name="View">
- <!-- NOTE: View does not have a javadoc. Do not place a comment BEFORE View to make sure it
- is NOT interpreted as Javadoc -->
-
- <!-- Supply an identifier name for this view, to later retrieve it
- with {@link android.view.View#findViewById View.findViewById()} or
- {@link android.app.Activity#findViewById Activity.findViewById()}.
- This must be a
- resource reference; typically you set this using the
- <code>@+</code> syntax to create a new ID resources.
- For example: <code>android:id="@+id/my_id"</code> which
- allows you to later retrieve the view
- with <code>findViewById(R.id.my_id)</code>. -->
- <attr name="id" format="reference" />
-
- <!-- Supply a tag for this view containing a String, to be retrieved
- later with {@link android.view.View#getTag View.getTag()} or
- searched for with {@link android.view.View#findViewWithTag
- View.findViewWithTag()}. It is generally preferable to use
- IDs (through the android:id attribute) instead of tags because
- they are faster and allow for compile-time type checking. -->
- <attr name="tag" format="string" />
-
- <!-- The initial horizontal scroll offset, in pixels.-->
- <attr name="scrollX" format="dimension" />
-
- <!-- The initial vertical scroll offset, in pixels. -->
- <attr name="scrollY" format="dimension" />
-
- <!-- A drawable to use as the background. This can be either a reference
- to a full drawable resource (such as a PNG image, 9-patch,
- XML state list description, etc), or a solid color such as "#ff000000"
- (black). -->
- <attr name="background" format="reference|color" />
-
- <!-- Boolean that controls whether a view can take focus. By default the user can not
- move focus to a view; by setting this attribute to true the view is
- allowed to take focus. This value does not impact the behavior of
- directly calling {@link android.view.View#requestFocus}, which will
- always request focus regardless of this view. It only impacts where
- focus navigation will try to move focus. -->
- <attr name="focusable" format="boolean" />
-
- <!-- Sets the circumstances under which this view will take focus. There are
- two choices: "weak" or "normal". The default value is "normal" for
- any focusable views. The focus type only applies if the view
- has been set to be focusable. -->
- <attr name="focusType">
- <!-- This view is focusable, but only if none of its descendants are already focused. -->
- <enum name="normal" value="0" />
- <!-- This view will always claim to be focusable. -->
- <enum name="weak" value="1" />
- </attr>
-
- <!-- Controls the initial visibility of the view. -->
- <attr name="visibility">
- <!-- Visible on screen; the default value. -->
- <enum name="visible" value="0" />
- <!-- Not displayed, but taken into account during layout (space is left for it). -->
- <enum name="invisible" value="1" />
- <!-- Completely hidden, as if the view had not been added. -->
- <enum name="gone" value="2" />
- </attr>
-
- <!-- Defines which scrollbars should be displayed on scrolling or not. -->
- <attr name="scrollbars">
- <!-- No scrollbar is displayed. -->
- <flag name="none" value="0x00000000" />
- <!-- Displays horizontal scrollbar only. -->
- <flag name="horizontal" value="0x00000100" />
- <!-- Displays vertical scrollbar only. -->
- <flag name="vertical" value="0x00000200" />
- </attr>
-
- <!-- Sets the width of vertical scrollbars and height of horizontal scrollbars. -->
- <attr name="scrollbarSize" />
-
- <!-- Text to display. (copied from TextView for the extra localization) -->
- <attr name="text" format="string" localization="suggested" />
-
- </declare-styleable>
-
- <!-- Attributes that can be used with a {@link android.view.ViewGroup} or any
- of its subclasses. Also see {@link #ViewGroup_Layout} for
- attributes that this class processes in its children. -->
- <declare-styleable name="ViewGroup">
- <!-- Defines whether a child is limited to draw inside of its bounds or not.
- This is useful with animations that scale the size of the children to more
- than 100% for instance. In such a case, this property should be set to false
- to allow the children to draw outside of their bounds. The default value of
- this property is true. -->
- <attr name="clipChildren" format="boolean" />
- <!-- Defines the layout animation to use the first time the ViewGroup is laid out.
- Layout animations can also be started manually after the first layout. -->
- <attr name="layoutAnimation" format="reference" />
- <!-- Defines whether a child's animation should be kept when it is over. Keeping
- the animations is useful with animation whose final state is different from
- the initial state of the View. This is particularly useful with animation
- whose fillAfter property is enabled. This property is set to false by default. -->
- <attr name="persistentDrawingCache">
- <!-- The drawing cache is not persisted after use. -->
- <flag name="none" value="0x0" />
- <!-- The drawing cache is persisted after a layout animation. -->
- <flag name="animation" value="0x1" />
- <!-- The drawing cache is persisted after a scroll. -->
- <flag name="scrolling" value="0x2" />
- <!-- The drawing cache is always persisted. -->
- <flag name="all" value="0x3" />
- </attr>
- </declare-styleable>
-
- <!-- This is the basic set of layout attributes that are common to all
- layout managers. These attributes are specified with the rest of
- a view's normal attributes (such as {@link android.R.attr#background},
- but will be parsed by the view's parent and ignored by the child.
- <p>The values defined here correspond to the base layout attribute
- class {@link android.view.ViewGroup.LayoutParams}. -->
- <declare-styleable name="ViewGroup_Layout">
- <!-- Specifies the basic width of the view. This is a required attribute
- for any view inside of a containing layout manager. Its value may
- be a dimension (such as "12dip") for a constant width or one of
- the special constants. -->
- <attr name="layout_width" format="dimension">
- <!-- The view should be as big as its parent (minus padding). -->
- <enum name="match_parent" value="-1" />
- <!-- The view should be only big enough to enclose its content (plus padding). -->
- <enum name="wrap_content" value="-2" />
- </attr>
-
- <!-- Specifies the basic height of the view. This is a required attribute
- for any view inside of a containing layout manager. Its value may
- be a dimension (such as "12dip") for a constant height or one of
- the special constants. -->
- <attr name="layout_height" format="dimension">
- <!-- The view should be as big as its parent (minus padding). -->
- <enum name="match_parent" value="-1" />
- <!-- The view should be only big enough to enclose its content (plus padding). -->
- <enum name="wrap_content" value="-2" />
- </attr>
- </declare-styleable>
-
- <!-- This is the basic set of layout attributes for layout managers that
- wish to place margins around their child views.
- These attributes are specified with the rest of
- a view's normal attributes (such as {@link android.R.attr#background},
- but will be parsed by the view's parent and ignored by the child.
- <p>The values defined here correspond to the base layout attribute
- class {@link android.view.ViewGroup.MarginLayoutParams}. -->
- <declare-styleable name="ViewGroup_MarginLayout">
- <attr name="layout_width" />
- <attr name="layout_height" />
- <!-- Specifies extra space on the left side of this view.
- This space is outside this view's bounds. -->
- <attr name="layout_marginLeft" format="dimension" />
- <!-- Specifies extra space on the top side of this view.
- This space is outside this view's bounds. -->
- <attr name="layout_marginTop" format="dimension" />
- <!-- Specifies extra space on the right side of this view.
- This space is outside this view's bounds. -->
- <attr name="layout_marginRight" format="dimension" />
- <!-- Specifies extra space on the bottom side of this view.
- This space is outside this view's bounds. -->
- <attr name="layout_marginBottom" format="dimension" />
- </declare-styleable>
-
- <!-- This is a linear layout. -->
- <declare-styleable name="LinearLayout">
- <!-- Should the layout be a column or a row? Use "horizontal"
- for a row, "vertical" for a column. The default is
- horizontal. -->
- <attr name="orientation" />
- <attr name="baselineAligned" format="boolean|reference" />
- <!-- When a linear layout is part of another layout that is baseline
- aligned, it can specify which of its children to baseline align to
- (i.e which child TextView).-->
- <attr name="baselineAlignedChildIndex" format="integer|color" min="0"/>
- <!-- Defines the maximum weight sum. If unspecified, the sum is computed
- by adding the layout_weight of all of the children. This can be
- used for instance to give a single child 50% of the total available
- space by giving it a layout_weight of 0.5 and setting the weightSum
- to 1.0. -->
- <attr name="weightSum" format="float" />
- </declare-styleable>
-
- <declare-styleable name="LinearLayout_Layout">
- <attr name="layout_width" />
- <attr name="layout_height" />
- <attr name="layout_weight" format="float" />
- <attr name="layout_gravity" />
- </declare-styleable>
-
- <declare-styleable name="TableLayout">
- <!-- The 0 based index of the columns to stretch. The column indices
- must be separated by a comma: 1, 2, 5. Illegal and duplicate
- indices are ignored. You can stretch all columns by using the
- value "*" instead. Note that a column can be marked stretchable
- and shrinkable at the same time. -->
- <attr name="stretchColumns" format="string" />
- <!-- The 0 based index of the columns to shrink. The column indices
- must be separated by a comma: 1, 2, 5. Illegal and duplicate
- indices are ignored. You can shrink all columns by using the
- value "*" instead. Note that a column can be marked stretchable
- and shrinkable at the same time. -->
- <attr name="shrinkColumns" format="string" />
- <!-- The 0 based index of the columns to collapse. The column indices
- must be separated by a comma: 1, 2, 5. Illegal and duplicate
- indices are ignored. -->
- <attr name="collapseColumns" format="string" />
- </declare-styleable>
-
- <!-- Test for deprecated attributes. -->
- <declare-styleable name="DeprecatedTest">
- <!-- Deprecated comments using delimiters.
- Ignored. {@deprecated In-line deprecated.} {@ignore Ignored}.
- -->
- <attr name="deprecated-inline" />
-
- <!-- Deprecated comments on their own line.
- @deprecated Multi-line version of deprecated
- that works till the next tag.
- @ignore This tag must be ignored
- -->
- <attr name="deprecated-multiline" />
-
- <!-- This attribute is not deprecated. -->
- <attr name="deprecated-not" />
-
- <!-- {@deprecated There is no other javadoc here. } -->
- <attr name="deprecated-no-javadoc" format="boolean" />
-
- </declare-styleable>
-
-</resources>
-
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_manifest_attrs.xml b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_manifest_attrs.xml
deleted file mode 100755
index 2335d257a..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/testdata/mock_manifest_attrs.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<resources>
- <!-- WARNING !!! THIS IS A MOCK FILE. DO NOT USE FOR DOCUMENTATION PURPOSES.
- This file has been trimmed down to only extract a number of interesting cases
- for unit tests.
-
- -->
-
- <!-- **************************************************************** -->
- <!-- These are the attributes used in AndroidManifest.xml. -->
- <!-- **************************************************************** -->
- <eat-comment />
-
- <!-- The overall theme to use for an activity. Use with either the
- application tag (to supply a default theme for all activities) or
- the activity tag (to supply a specific theme for that activity).
-
- <p>This automatically sets
- your activity's Context to use this theme, and may also be used
- for "starting" animations prior to the activity being launched (to
- better match what the activity actually looks like). It is a reference
- to a style resource defining the theme. If not set, the default
- system theme will be used. -->
- <attr name="theme" format="reference" />
-
- <!-- A user-legible name for the given item. Use with the
- application tag (to supply a default label for all application
- components), or with the activity, receiver, service, or instrumentation
- tag (to supply a specific label for that component). It may also be
- used with the intent-filter tag to supply a label to show to the
- user when an activity is being selected based on a particular Intent.
-
- <p>The given label will be used wherever the user sees information
- about its associated component; for example, as the name of a
- main activity that is displayed in the launcher. You should
- generally set this to a reference to a string resource, so that
- it can be localized, however it is also allowed to supply a plain
- string for quick and dirty programming. -->
- <attr name="label" format="reference|string" />
-
- <!-- A Drawable resource providing a graphical representation of its
- associated item. Use with the
- application tag (to supply a default icon for all application
- components), or with the activity, receiver, service, or instrumentation
- tag (to supply a specific icon for that component). It may also be
- used with the intent-filter tag to supply an icon to show to the
- user when an activity is being selected based on a particular Intent.
-
- <p>The given icon will be used to display to the user a graphical
- representation of its associated component; for example, as the icon
- for main activity that is displayed in the launcher. This must be
- a reference to a Drawable resource containing the image definition. -->
- <attr name="icon" format="reference" />
-
- <!-- A unique name for the given item. This must use a Java-style naming
- convention to ensure the name is unique, for example
- "com.mycompany.MyName". -->
- <attr name="name" format="string" />
-
- <!-- Internal version code. This is the number used to determine whether
- one version is more recent than another: it has no other meaning than
- that higher numbers are more recent. You could use this number to
- encode a "x.y" in the lower and upper 16 bits, make it a build
- number, simply increase it by one each time a new version is
- released, or define it however else you want, as long as each
- successive version has a higher number. This is not a version
- number generally shown to the user, that is usually supplied
- with {@link android.R.attr#versionName}. -->
- <attr name="versionCode" format="integer" />
-
- <!-- The text shown to the user to indicate the version they have. This
- is used for no other purpose than display to the user; the actual
- significant version number is given by {@link android.R.attr#versionCode}. -->
- <attr name="versionName" format="string" />
-
- <!-- .............. -->
-
- <!-- The <code>manifest</code> tag is the root of an
- <code>AndroidManifest.xml</code> file,
- describing the contents of an Android package (.apk) file. One
- attribute must always be supplied: <code>package</code> gives a
- unique name for the package, using a Java-style naming convention
- to avoid name collisions. For example, applications published
- by Google could have names of the form
- <code>com.google.app.<em>appname</em></code> -->
- <declare-styleable name="AndroidManifest">
- <attr name="versionCode" />
- <attr name="versionName" />
- </declare-styleable>
-
- <!-- The <code>application</code> tag describes application-level components
- contained in the package, as well as general application
- attributes. Many of the attributes you can supply here (such
- as theme, label, icon, permission, process, taskAffinity,
- and allowTaskReparenting) serve
- as default values for the corresponding attributes of components
- declared inside of the application.
-
- <p>Inside of this element you specify what the application contains,
- using the elements {@link #AndroidManifestProvider provider},
- {@link #AndroidManifestService service},
- {@link #AndroidManifestReceiver receiver},
- {@link #AndroidManifestActivity activity},
- {@link #AndroidManifestActivityAlias activity-alias}, and
- {@link #AndroidManifestUsesLibrary uses-library}. The application tag
- appears as a child of the root {@link #AndroidManifest manifest} tag. -->
- <declare-styleable name="AndroidManifestApplication" parent="AndroidManifest">
- <attr name="name" />
- <attr name="theme" />
- <attr name="label" />
- <attr name="icon" />
- <attr name="cantSaveState" format="boolean" />
- </declare-styleable>
-
- <!-- The <code>permission</code> tag declares a security permission that can be
- used to control access from other packages to specific components or
- features in your package (or other packages). See the
- <a href="{@docRoot}guide/topics/security/security.html">Security and Permissions</a>
- document for more information on permissions.
-
- <p>This appears as a child tag of the root
- {@link #AndroidManifest manifest} tag. -->
- <declare-styleable name="AndroidManifestPermission" parent="AndroidManifest">
- <!-- Required public name of the permission, which other components and
- packages will use when referring to this permission. This is a string using
- Java-style scoping to ensure it is unique. The prefix will often
- be the same as our overall package name, for example
- "com.mycompany.android.myapp.SomePermission". -->
- <attr name="name" />
- <attr name="label" />
- <attr name="icon" />
- </declare-styleable>
-
-
- <!-- The <code>activity-alias</code> tag declares a new
- name for an existing {@link #AndroidManifestActivity activity}
- tag.
-
- <p>Zero or more {@link #AndroidManifestIntentFilter intent-filter}
- tags can be included inside of an activity-alias, to specify the Intents
- that it can handle. If none are specified, the activity can
- only be started through direct specification of its class name.
- The activity-alias tag appears as a child tag of the
- {@link #AndroidManifestApplication application} tag. -->
- <declare-styleable name="AndroidManifestActivityAlias" parent="AndroidManifestApplication">
- <!-- Required name of the class implementing the activity, deriving from
- {@link android.app.Activity}. This is a fully
- qualified class name (for example, com.mycompany.myapp.MyActivity); as a
- short-hand if the first character of the class
- is a period then it is appended to your package name. -->
- <attr name="name" />
- <attr name="label" />
- <attr name="icon" />
- </declare-styleable>
-
- <declare-styleable name="AndroidManifestNewParentNewElement"
- parent="AndroidManifest.AndroidManifestNewParent">
- <attr name="name" />
- <attr name="label" />
- <attr name="icon" />
- </declare-styleable>
-
-</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/View.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/View.java
deleted file mode 100644
index a80a98daf..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/View.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2008 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 mock_android.view;
-
-public class View {
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/ViewGroup.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/ViewGroup.java
deleted file mode 100644
index 466470fc1..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/view/ViewGroup.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2008 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 mock_android.view;
-
-public class ViewGroup extends View {
-
- public class MarginLayoutParams extends LayoutParams {
-
- }
-
- public class LayoutParams {
-
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/LinearLayout.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/LinearLayout.java
deleted file mode 100644
index 3870a63d9..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/LinearLayout.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2008 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 mock_android.widget;
-
-import mock_android.view.ViewGroup;
-
-public class LinearLayout extends ViewGroup {
-
- public class LayoutParams extends mock_android.view.ViewGroup.LayoutParams {
-
- }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/TableLayout.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/TableLayout.java
deleted file mode 100644
index e455e7d61..000000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/mock_android/widget/TableLayout.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2008 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 mock_android.widget;
-
-import mock_android.view.ViewGroup;
-
-public class TableLayout extends ViewGroup {
-
- public class LayoutParams extends MarginLayoutParams {
-
- }
-
-}