summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Peterson2013-07-15 15:12:09 (EDT)
committerJason Peterson2013-07-15 15:12:09 (EDT)
commit85ece13ee3350bb257b01c68eda34f1ace01d265 (patch)
treea41c4fa39ac8ec8cc853f844eae85e49ba07fe33
parenteeff3f460804fde82977d1b4159e91c29d70e783 (diff)
downloadwebtools.jsdt.tests-85ece13ee3350bb257b01c68eda34f1ace01d265.zip
webtools.jsdt.tests-85ece13ee3350bb257b01c68eda34f1ace01d265.tar.gz
webtools.jsdt.tests-85ece13ee3350bb257b01c68eda34f1ace01d265.tar.bz2
[384319] CPU utilization to 100% when this is appended to new objectv201307161720
definition
-rw-r--r--features/org.eclipse.wst.jsdt_tests.feature/feature.xml128
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.core.prefs406
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.ui.prefs6
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/META-INF/MANIFEST.MF5
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/JSDTCompilerTests.java118
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java194
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java214
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest.java8713
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java9671
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTestKeyword.java10215
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionRecoveryTest.java1031
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ComplianceDiagnoseTest.java2375
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietCompletionTest.java2033
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DietRecoveryTest.java7680
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/DualParseSyntaxErrorTest.java206
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationCompletionTest.java385
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ExplicitConstructorInvocationSelectionTest.java229
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/FieldAccessCompletionTest.java1508
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/InnerTypeCompletionTest.java456
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/JavadocCompletionParserTest.java227
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/LabelStatementCompletionTest.java492
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/MethodInvocationCompletionTest.java521
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/NameReferenceCompletionTest.java802
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java180
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ReferenceTypeCompletionTest.java1433
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/RunCompletionParserTests.java108
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionJavadocTest.java865
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest.java512
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest2.java229
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SelectionTest3.java176
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SingleCompletionTest.java57
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceElementParserTest.java5261
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceImport.java52
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceMethod.java8
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourcePackage.java49
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceType.java64
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SourceUnit.java56
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/StatementRecoveryTest.java2827
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/SyntaxErrorTest.java32
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestAll.java120
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/TestSourceElementRequestor.java2
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java77
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractComparableTest.java49
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AbstractRegressionTest.java221
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/AssignmentTest.java272
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicAnalyseTests.java363
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicErrorTests.java57
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicParserTests.java17
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java126
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/CompilerInvocationTests.java107
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/Compliance_1_3.java273
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ConstantTest.java259
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/DeprecatedTest.java737
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java227
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java515
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FieldAccessTest.java199
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/FlowAnalysisTest.java1242
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ForStatementTest.java77
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferResolveTests.java196
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java3623
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java5692
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalHexFloatTest.java409
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InternalScannerTest.java3
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocBugsTest.java5193
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest.java12
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTestForInterface.java2219
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_3.java3914
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_4.java3908
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/JavadocTest_1_5.java2940
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LocalVariableTest.java363
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/LookupTest.java2702
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/MethodVerifyTest.java7376
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java184
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTests.java1889
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceImplTransformations.java3177
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NullReferenceTest.java6
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NumericTest.java95
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/OaaMetadataTests.java150
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemConstructorTest.java136
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java113
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RegressionTestSetup.java3
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RunComparableTests.java70
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/RuntimeTests.java540
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ScannerTest.java310
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java136
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/StaticImportTest.java1875
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SuperTypeTest.java266
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SwitchTest.java576
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java35
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TryStatementTest.java5366
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/VarargsTest.java2067
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/XLargeTest.java11826
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetClassLoader.java118
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/CodeSnippetRunner.java471
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/eval/target/IDEInterface.java157
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AmbiguousMethodTest.java1988
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/ArrayTest.java371
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/BooleanTest.java1151
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_4.java3431
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/Compliance_1_5.java3456
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/AbstractReader.java54
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VMLauncher.java284
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/J9VirtualMachine.java82
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/JRockitVMLauncher.java193
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVMLauncher.java470
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/LocalVirtualMachine.java231
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/MacVMLauncher.java135
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/NullConsoleReader.java42
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/ProxyConsoleReader.java68
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/RuntimeConstants.java21
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarJ9VMLauncher.java138
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/SideCarVMLauncher.java133
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/StandardVMLauncher.java221
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetException.java34
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/TargetInterface.java148
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/runtime/VMInputStream.java110
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/AbstractSearchTest.java210
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/SearchTests.java49
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestConstructorSearch.java343
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestFieldSearch.java180
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestFunctionSearch.java110
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestGetAllSubtypeNames.java57
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestMethodPattern.java430
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestMethodSearch.java178
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestTypeDeclarationPattern.java461
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/search/TestVarSearch.java117
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/TestVerifier.java208
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.core.prefs401
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.ui.prefs6
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/build.properties3
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/plugin.xml2
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunCompilerTests.java3
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterAST3Test.java624
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java506
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java3405
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterRecoveryTest.java923
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java132
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java5418
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java8652
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java10
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTModelBridgeTests.java1419
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTStructuralPropertyTest.java348
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BatchASTCreationTests.java1670
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/CompatibilityRulesTests.java787
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunAllTests.java8
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunConverterTests.java5
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/internal/Activator.java40
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AccessRestrictionsTests.java1023
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java1141
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachedJavadocTests.java509
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java824
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassNameTests.java1169
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java2416
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionWithMissingTypesTests_1_5.java569
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JSDTModelTests.java141
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaScriptLikeExtensionsTests.java7
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/RunCompletionModelTests.java100
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/SnippetCompletionTests_1_5.java67
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopySearchTests.java2
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingTest.java9
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingTrackingTest.java2
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingTypeDeclTest.java1084
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/LineCommentOffsetsTest.java207
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/modifying/ASTRewritingModifyingCopyTest.java438
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/modifying/ASTRewritingModifyingInsertTest.java15
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/modifying/ASTRewritingModifyingMoveTest.java488
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/modifying/ASTRewritingModifyingRemoveTest.java267
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/modifying/ASTRewritingModifyingTest.java4
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/utils/BundleResourceUtil.java231
-rw-r--r--tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/utils/TestProjectSetup.java352
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/.classpath14
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/.settings/org.eclipse.jdt.core.prefs398
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/build.properties41
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/plugin.xml9
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/EditorTests.java10
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/JSDTUITests.java29
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/AddToNavigatorTests.java117
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/AllContentAssistTests.java108
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/AlreadyDefinedFunctionAssingedToFieldTests.java123
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/AssignToFuncArgWithJSDocedType.java120
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/BrowserLibraryTests.java131
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/CamelCasingTests.java209
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/CamelCasingTests_Edited.java223
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ClosureTests.java204
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ConstructorTests.java348
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ConstructorTests_Edited.java254
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ContentAssistTestUtilities.java385
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ContentAssistTests.java496
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/Dom5LibraryTests.java246
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/DoublyNestedFunctionTests.java156
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/DoublyNestedFunctionTests_Edited.java114
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/DuplicatesTests.java207
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/FuncArgsWithFullyQualifedTypeNamesTests.java111
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/FunctionParamsTest.java100
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/FunctionPrototypeTests.java116
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalFunctionTests.java253
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalFunctionTests_Edited.java231
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalObjectLiteralsTests.java202
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalShadowedByFuncArgTests.java115
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalVariableTests.java204
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalVariableTests_Edited.java165
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalVariable_AssignmentOnly_DefinedInOneFile_Tests.java459
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalVariable_LocalDeclaration_DefinedInMultiFiles_Tests.java766
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalVariable_LocalDeclaration_DefinedInOneFile_Tests.java510
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/GlobalsFieldAssignmentsTests.java207
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/InnerFunctionTests.java269
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/InnerFunctionTests_Edited.java194
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/LocalVarDefinedInFunctionInObjectLiteralTests.java107
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/NestedVarsTests.java106
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/OrderOfRecomendationsTests.java117
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/OtherContentAssistTests.java89
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ProposalInfoTest.java143
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/ProposalInfoTest_Edited.java140
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/StaticTests.java183
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/StaticTests_Edited.java188
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/TypeTests.java178
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/contentassist/TypeTests_Edited.java159
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/documentation/DocumentationTest.java140
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/format/FormattingTests.java174
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/hyperlink/HyperLinkTest.java92
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/hyperlink/HyperLinkTestUtilities.java144
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/internal/Activator.java6
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/internal/JsStorageEditorInput.java72
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/utils/BundleResourceUtil.java231
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/utils/FileUtil.java136
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/utils/ProjectUnzipUtility.java365
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/utils/StringUtils.java21
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/src/org/eclipse/wst/jsdt/ui/tests/utils/TestProjectSetup.java455
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist.zipbin3814 -> 0 bytes
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/.project17
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/.settings/.jsdtscope9
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/.settings/org.eclipse.wst.jsdt.ui.superType.container1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/.settings/org.eclipse.wst.jsdt.ui.superType.name1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/lib/folder/doctest.js4
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/AssignToFuncArgWithJSDocedType_0.js11
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/AssignToFuncArgWithJSDocedType_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/HyperLink_0.js16
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/HyperLink_1.js2
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/JSObjectModel_0.js14
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/JSObjectModel_1.js10
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/OrderOfRecomendations_0.js13
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/OrderOfRecomendations_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/StaticTests_0.js59
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/StaticTests_1.js11
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestAddToNavigator_0.js7
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestAddToNavigator_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestAlreadyDefinedFunctionAssingedToField_0.js12
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestAlreadyDefinedFunctionAssingedToField_1.js7
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestAlreadyDefinedFunctionAssingedToField_2.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestBrowserLibrary_0.js28
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestBrowserLibrary_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestClosureReturnValue_0.js28
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestClosureReturnValue_1.js8
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestClosure_ArgumentTypeAddedTo_1.js4
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestClosure_ArgumentTypeAddedTo_2.js4
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestConstructorCamelCase_0.js27
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestConstructorCamelCase_1.js5
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestDom5Library_0.js54
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestFuncArgsWithFullyQualifedTypeNames_0.js13
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestFuncArgsWithFullyQualifedTypeNames_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestFunctionParams_0.js6
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestFunctionParams_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestFunctionPrototype_0.js28
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestFunctionPrototype_1.js3
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobalObjectLiterals_0.js22
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobalObjectLiterals_1.js9
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobalShadowedByFuncArg_0.js8
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobalShadowedByFuncArg_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobalVarsDefinedInClosure_0.js19
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobalVarsDefinedInClosure_1.js7
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_AssignmentOnly_DeffinedInOneFile_0.js119
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_AssignmentOnly_DeffinedInOneFile_1.js29
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_FieldAssignments_0.js61
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_FieldAssignments_1.js35
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_FieldAssignments_2.js2
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_LocalDeclaration_DeffinedInMultiFiles_0.js119
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_LocalDeclaration_DeffinedInMultiFiles_1.js169
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_LocalDeclaration_DeffinedInMultiFiles_2.js29
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_LocalDeclaration_DeffinedInOneFile_0.js125
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestGlobals_LocalDeclaration_DeffinedInOneFile_1.js33
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestInnerFunctions_0.js38
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestInnerFunctions_1.js9
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestJSClasses_0.js38
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestJSClasses_1.js11
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestLocalVarDefinedInFunctionInObjectLiteral_0.js8
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestLocalVarDefinedInFunctionInObjectLiteral_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestNamedFunctionsAssignedToVariables_0.js11
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestNamedFunctionsAssignedToVariables_1.js3
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestNestedVars_0.js19
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestNestedVars_1.js2
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestProposalInfo_0.js35
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/TestProposalInfo_1.js5
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/ThisReferenceInMemberAndStaticFunctions_0.js12
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/ThisReferenceInMemberAndStaticFunctions_1.js3
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test0_0.js65
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test0_1.js7
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test10_0.js11
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test10_1.js2
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test11_0.js18
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test11_1.js8
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test13_0.js22
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test13_1.js7
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test14_0.js3
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test2_0.js34
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test2_1.js15
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test5.js8
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test6.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test7.js13
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test9_0.js8
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/root/test9_1.js1
-rw-r--r--tests/org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist/testjsdocuments.jarbin0 -> 895 bytes
314 files changed, 20087 insertions, 175737 deletions
diff --git a/features/org.eclipse.wst.jsdt_tests.feature/feature.xml b/features/org.eclipse.wst.jsdt_tests.feature/feature.xml
index 9b1f334..d52216f 100644
--- a/features/org.eclipse.wst.jsdt_tests.feature/feature.xml
+++ b/features/org.eclipse.wst.jsdt_tests.feature/feature.xml
@@ -1,64 +1,64 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.jsdt_tests.feature"
- label="%featureName"
- version="1.4.1.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.wst.jsdt.core.tests.compiler"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.jsdt.core.tests.model"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.jsdt.ui.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wtp.releng.versionchecker"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wtp.releng.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.jsdt.debug.rhino.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.jsdt.debug.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.wst.jsdt_tests.feature"
+ label="%featureName"
+ version="1.5.0.qualifier"
+ provider-name="%providerName"
+ license-feature="org.eclipse.license"
+ license-feature-version="1.0.0.qualifier">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="license.html">
+ %license
+ </license>
+
+ <plugin
+ id="org.eclipse.wst.jsdt.core.tests.compiler"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.wst.jsdt.core.tests.model"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.wst.jsdt.ui.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.wtp.releng.versionchecker"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.wtp.releng.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.wst.jsdt.debug.rhino.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.wst.jsdt.debug.core.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.core.prefs
index 839a233..c52af75 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,394 @@
-#Mon Dec 07 03:40:31 EST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
-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.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
+#Wed Jul 18 22:25:27 EDT 2012
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=3
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=64
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.comment.line_length=78
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.continuation_indentation=3
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=insert
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.compiler.problem.unusedLabel=error
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.builder.invalidClasspath=ignore
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=32
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=3
+org.eclipse.jdt.core.formatter.lineSplit=999
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=insert
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=64
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.ui.prefs b/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..03aa56b
--- /dev/null
+++ b/tests/org.eclipse.wst.jsdt.core.tests.compiler/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,6 @@
+#Wed Jul 18 22:25:27 EDT 2012
+formatter_settings_version=11
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*******************************************************************************\r\n * Licensed Materials - Property of IBM\r\n * \u00A9 Copyright IBM Corporation ${year}. All Rights Reserved.\r\n * U.S. Government Users Restricted Rights - Use, duplication or disclosure\r\n * restricted by GSA ADP Schedule Contract with IBM Corp. \r\n *******************************************************************************/\r\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+formatter_profile=_SSE Formatting
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.jsdt.core.tests.compiler/META-INF/MANIFEST.MF
index 810a2ee..966874b 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.wst.jsdt.core.tests.compiler/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.wst.jsdt.core.tests.compiler; singleton:=true
-Bundle-Version: 1.0.502.qualifier
+Bundle-Version: 1.0.600.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
@@ -12,11 +12,8 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
Export-Package: org.eclipse.wst.jsdt.core.tests.compiler,
org.eclipse.wst.jsdt.core.tests.compiler.parser,
org.eclipse.wst.jsdt.core.tests.compiler.regression,
- org.eclipse.wst.jsdt.core.tests.eval.target,
- org.eclipse.wst.jsdt.core.tests.future.compiler.regression,
org.eclipse.wst.jsdt.core.tests.interpret,
org.eclipse.wst.jsdt.core.tests.junit.extension,
- org.eclipse.wst.jsdt.core.tests.runtime,
org.eclipse.wst.jsdt.core.tests.util
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/JSDTCompilerTests.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/JSDTCompilerTests.java
index 7793053..7f5044e 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/JSDTCompilerTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/JSDTCompilerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,15 +17,31 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.DualParseSyntaxErrorTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.FieldAccessCompletionTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.JavadocCompletionParserTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.NameReferenceCompletionTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.ParserTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.ReferenceTypeCompletionTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.SelectionTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.SelectionTest3;
+import org.eclipse.wst.jsdt.core.tests.compiler.parser.StatementRecoveryTest;
import org.eclipse.wst.jsdt.core.tests.compiler.parser.SyntaxErrorTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.regression.ASTImplTests;
+import org.eclipse.wst.jsdt.core.tests.compiler.regression.AssignmentTest;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicAnalyseTests;
+import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicJsdocTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicParserTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.BasicResolveTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.CharOperationTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.regression.CompilerInvocationTests;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.InferTypesTests;
+import org.eclipse.wst.jsdt.core.tests.compiler.regression.InternalScannerTest;
+import org.eclipse.wst.jsdt.core.tests.compiler.regression.ScannerTest;
import org.eclipse.wst.jsdt.core.tests.compiler.regression.UtilTest;
import org.eclipse.wst.jsdt.core.tests.compiler.util.ExclusionTests;
import org.eclipse.wst.jsdt.core.tests.interpret.BasicInterpretTest;
+import org.eclipse.wst.jsdt.core.tests.search.SearchTests;
/**
* Run all compiler regression tests
@@ -48,103 +64,47 @@ public static Test suite() {
ArrayList standardTests = new ArrayList();
// regression tests
+ standardTests.add(AssignmentTest.class);
+ standardTests.add(ASTImplTests.class);
+ standardTests.add(BasicAnalyseTests.class);
+ standardTests.add(BasicJsdocTests.class);
standardTests.add(BasicParserTests.class);
- standardTests.add(InferTypesTests.class);
standardTests.add(BasicResolveTests.class);
- standardTests.add(BasicAnalyseTests.class);
standardTests.add(CharOperationTest.class);
+ standardTests.add(CompilerInvocationTests.class);
+ standardTests.add(InferTypesTests.class);
+ standardTests.add(InternalScannerTest.class);
+ standardTests.add(ScannerTest.class);
standardTests.add(UtilTest.class);
// parser tests
+
+ standardTests.add(DualParseSyntaxErrorTest.class);
+ standardTests.add(FieldAccessCompletionTest.class);
+ standardTests.add(JavadocCompletionParserTest.class);
+ standardTests.add(NameReferenceCompletionTest.class);
+ standardTests.add(ParserTest.class);
+ standardTests.add(ReferenceTypeCompletionTest.class);
+ standardTests.add(SelectionTest.class);
+ standardTests.add(SelectionTest3.class);
+ standardTests.add(StatementRecoveryTest.class);
standardTests.add(SyntaxErrorTest.class);
+
// interpret tests
standardTests.add(BasicInterpretTest.class);
-
-
-// standardTests.addAll(JavadocTest.allTestClasses);
-
-// standardTests.add(BasicErrorTests.class);
-
- // // add all javadoc tests
-// for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) {
-// standardTests.add(JavadocTest.ALL_CLASSES.get(i));
-// }
-//
TestSuite all = new TestSuite("JSDT 'Compiler' Tests");
all.addTest(ExclusionTests.suite());
+ all.addTest(SearchTests.suite());
-
-// int possibleComplianceLevels = AbstractCompilerTest.getPossibleComplianceLevels();
-// if ((possibleComplianceLevels & AbstractCompilerTest.F_1_3) != 0) {
-// ArrayList tests_1_3 = (ArrayList)standardTests.clone();
-// tests_1_3.add(Compliance_1_3.class);
-// tests_1_3.add(JavadocTest_1_3.class);
-// // Reset forgotten subsets tests
-// TestCase.TESTS_PREFIX = null;
-// TestCase.TESTS_NAMES = null;
-// TestCase.TESTS_NUMBERS= null;
-// TestCase.TESTS_RANGE = null;
-// TestCase.RUN_ONLY_ID = null;
-// all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_3, tests_1_3));
-// }
-// if ((possibleComplianceLevels & AbstractCompilerTest.F_1_4) != 0) {
-// ArrayList tests_1_4 = (ArrayList)standardTests.clone();
-// tests_1_4.add(AssertionTest.class);
-// tests_1_4.add(Compliance_1_4.class);
-// tests_1_4.add(ClassFileReaderTest_1_4.class);
-// tests_1_4.add(JavadocTest_1_4.class);
-// // Reset forgotten subsets tests
-// TestCase.TESTS_PREFIX = null;
-// TestCase.TESTS_NAMES = null;
-// TestCase.TESTS_NUMBERS= null;
-// TestCase.TESTS_RANGE = null;
-// TestCase.RUN_ONLY_ID = null;
-// all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_4, tests_1_4));
-// }
-// if ((possibleComplianceLevels & AbstractCompilerTest.F_1_5) != 0) {
-// ArrayList tests_1_5 = (ArrayList)standardTests.clone();
-// tests_1_5.addAll(RunComparableTests.ALL_CLASSES);
-// tests_1_5.add(AssertionTest.class);
-// tests_1_5.add(ClassFileReaderTest_1_5.class);
-// tests_1_5.add(GenericTypeSignatureTest.class);
-// tests_1_5.add(InternalHexFloatTest.class);
-// tests_1_5.add(JavadocTest_1_5.class);
-// tests_1_5.add(BatchCompilerTest.class);
-// tests_1_5.add(ExternalizeStringLiterals15Test.class);
-// // Reset forgotten subsets tests
-// TestCase.TESTS_PREFIX = null;
-// TestCase.TESTS_NAMES = null;
-// TestCase.TESTS_NUMBERS= null;
-// TestCase.TESTS_RANGE = null;
-// TestCase.RUN_ONLY_ID = null;
-// all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_5, tests_1_5));
-// }
-// if ((possibleComplianceLevels & AbstractCompilerTest.F_1_6) != 0) {
-// ArrayList tests_1_6 = (ArrayList)standardTests.clone();
-// tests_1_6.addAll(RunComparableTests.ALL_CLASSES);
-// tests_1_6.add(AssertionTest.class);
-// tests_1_6.add(ClassFileReaderTest_1_5.class);
-// tests_1_6.add(GenericTypeSignatureTest.class);
-// tests_1_6.add(InternalHexFloatTest.class);
-// tests_1_6.add(JavadocTest_1_5.class);
-// tests_1_6.add(BatchCompilerTest.class);
-// tests_1_6.add(ExternalizeStringLiterals15Test.class);
-// tests_1_6.add(StackMapAttributeTest.class);
-// // Reset forgotten subsets tests
-// TestCase.TESTS_PREFIX = null;
-// TestCase.TESTS_NAMES = null;
-// TestCase.TESTS_NUMBERS= null;
-// TestCase.TESTS_RANGE = null;
-// TestCase.RUN_ONLY_ID = null;
-// all.addTest(AbstractCompilerTest.buildComplianceTestSuite(AbstractCompilerTest.COMPLIANCE_1_6, tests_1_6));
-// }
+
for (Iterator iter = standardTests.iterator(); iter.hasNext();) {
Class test = (Class) iter.next();
all.addTestSuite(test);
}
+
return all;
}
}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java
deleted file mode 100644
index bf642bb..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/AllocationExpressionCompletionTest.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be an AllocationExpression.
- */
-public class AllocationExpressionCompletionTest extends AbstractCompletionTest {
-public AllocationExpressionCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(AllocationExpressionCompletionTest.class);
-}
-/*
- * Completion inside an if statement.
- */
-public void testInIfStatement() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " if (true) { \n" +
- " new z.y.X(1, 2, i); \n" +
- " } \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnAllocationExpression:new z.y.X(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnAllocationExpression:new z.y.X(1, 2)>;\n" +
- " }\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete inside an if statement>"
- );
-}
-/*
- * Completion on a constructor invocation with no qualification and using a qualified type name.
- *
- * ie. ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
- * where ClassType is a qualified type name
- */
-public void testNoQualificationQualifiedTypeName() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new z.y.X(1, 2, i); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnAllocationExpression:new z.y.X(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnAllocationExpression:new z.y.X(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on non qualified instance creation with qualified type name>"
- );
-}
-/*
- * Completion on a constructor invocation with no qualification and using a simple type name.
- *
- * ie. ClassInstanceCreationExpression ::= 'new' ClassType '(' ArgumentListopt ')' ClassBodyopt
- * where ClassType is a simple type name
- */
-public void testNoQualificationSimpleTypeName() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " new X(1, 2, i); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnAllocationExpression:new X(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnAllocationExpression:new X(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on non qualified instance creation with simple type name>"
- );
-}
-/*
- * Completion on a constructor invocation qualified with a name.
- *
- * ie. ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testQualifiedWithName() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar {\n" +
- " void foo() { \n" +
- " Buz.x.new X(1, 2, i); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnQualifiedAllocationExpression:Buz.x.new X(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnQualifiedAllocationExpression:Buz.x.new X(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on name qualified instance creation>"
- );
-}
-/*
- * Completion on a constructor invocation qualified with a primary.
- *
- * ie. ClassInstanceCreationExpression ::= Primary '.' 'new' SimpleName '(' ArgumentListopt ')' ClassBodyopt
- */
-public void testQualifiedWithPrimary() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " primary().new X(1, 2, i); \n" +
- " } \n" +
- "}\n",
- // completeBehind:
- "X(1, 2,",
- // expectedCompletionNodeToString:
- "<CompleteOnQualifiedAllocationExpression:primary().new X(1, 2)>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnQualifiedAllocationExpression:primary().new X(1, 2)>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "",
- // test name
- "<complete on primary qualified instance creation>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java
deleted file mode 100644
index a0bf291..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ClassLiteralAccessCompletionTest.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-/**
- * Completion is expected to be a ClassLiteralAccess.
- */
-public class ClassLiteralAccessCompletionTest extends AbstractCompletionTest {
-public ClassLiteralAccessCompletionTest(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(ClassLiteralAccessCompletionTest.class);
-}
-/*
- * Completion on the keyword 'class' on an array type
- */
-public void testArrayType() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " String[].; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "String[].",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:String[].>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:String[].>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "String[].",
- // test name
- "<complete on array type member>"
- );
-}
-/*
- * Test access to the keyword 'class' on an array type
- * where the keyword is non empty.
- */
-public void testArrayTypeWithNonEmptyIdentifier() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " String[].class; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "String[].cl",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:String[].cl>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:String[].cl>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "cl",
- // expectedReplacedSource:
- "String[].class",
- // test name
- "<complete on array type member with non empty identifier>"
- );
-}
-/*
- * Completion on the keyword 'class' on a primitive array type
- */
-public void testPrimitiveArrayType() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int[].; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "int[].",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:int[].>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:int[].>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "int[].",
- // test name
- "<complete on primitive array type member>"
- );
-}
-/*
- * Completion on the keyword 'class' on a primitive array type where the
- * keyword is non empty
- */
-public void testPrimitiveArrayTypeWithNonEmptyIdentifier() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int[].class; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "int[].cl",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:int[].cl>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:int[].cl>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "cl",
- // expectedReplacedSource:
- "int[].class",
- // test name
- "<complete on primitive array type member with non empty identifier>"
- );
-}
-/*
- * Completion on the keyword 'class' on a primitive type
- */
-public void testPrimitiveType() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int.; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "int.",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:int.>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:int.>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "",
- // expectedReplacedSource:
- "int.",
- // test name
- "<complete on primitive type member>"
- );
-}
-/*
- * Completion on the keyword 'class' on a primitive type where the
- * keyword is non empty
- */
-public void testPrimitiveTypeWithNonEmptyIdentifier() {
- this.runTestCheckMethodParse(
- // compilationUnit:
- "class Bar { \n" +
- " void foo() { \n" +
- " int.class; \n" +
- " } \n" +
- "} \n",
- // completeBehind:
- "int.cl",
- // expectedCompletionNodeToString:
- "<CompleteOnClassLiteralAccess:int.cl>",
- // expectedUnitDisplayString:
- "class Bar {\n" +
- " Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnClassLiteralAccess:int.cl>;\n" +
- " }\n" +
- "}\n",
- // expectedCompletionIdentifier:
- "cl",
- // expectedReplacedSource:
- "int.class",
- // test name
- "<complete on primitive type member with non empty identifier>"
- );
-}
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest.java
deleted file mode 100644
index 3e3f3ce..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest.java
+++ /dev/null
@@ -1,8713 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.internal.codeassist.complete.*;
-
-public class CompletionParserTest extends AbstractCompletionTest {
-public CompletionParserTest(String testName) {
- super(testName);
-}
-static {
-// TESTS_NAMES = new String[] { "testXA_1FGGUQF_1FHSL8H_1" };
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(CompletionParserTest.class);
-}
-public void testA() {
- String str =
- " function foo(){\n" +
- " var i;\n" +
- " if (i instanceof O) {\n" +
- " }\n" +
- " var s = \"hello\";\n" +
- " s.}\n" +
- "\n";
-
- String testName = "<complete on methods/fields>";
- String completeBehind = "s.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:s.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var i;\n" +
- " if ((i instanceof O))\n" +
- " {\n" +
- " }\n" +
- " var s = \"hello\";\n" +
- " <CompleteOnMemberAccess:s.>;\n" +
- "}" +
- "\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testAA_1() {
- String str =
- " function foo() {\n" +
- " var maxUnits = 0;\n" +
- " var unitResult = \n" +
- " new CompilationUnitResult(\n" +
- " null, \n" +
- " i, \n" +
- " maxUnits); \n" +
- " }" +
- "}\n";
-
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var maxUnits = 0;\n" +
- " var unitResult = <CompleteOnName:n>;\n" +
- " CompilationUnitResult(null, i, maxUnits);\n"+
- "}\n";
- String expectedReplacedSource = "new";
- String testName = "<complete on initializer (new)>";
-
- int cursorLocation = str.indexOf("new CompilationUnitResult(") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testAA_2() {
- String str =
- "// test unicode \\u000a var c = 1; \n" +
- "var b =c; \n";
- String testName = "<unicode in comment complete on variable>";
- String expectedCompletionNodeToString = "<CompleteOnName:c>";
- String completionIdentifier = "c";
- String expectedReplacedSource = "c";
- int cursorLocation = str.indexOf("var b =c") -1 /*+ completeBehind.length() - 1*/;
- String expectedUnitDisplayString =
- "// test unicode \\u000a var c = 1; \n" +
- "var b = <CompleteOnName:c>;\n";
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-//public void testAA_3() {
-// String str =
-// "'abc\\u0027def';\n";
-// String testName = "<unicode in comment complete on variable>";
-// String expectedCompletionNodeToString = "<CompleteOnName:c>";
-// String completionIdentifier = "c";
-// String expectedReplacedSource = "c";
-// int cursorLocation = str.indexOf("var b =") -1 /*+ completeBehind.length() - 1*/;
-// String expectedUnitDisplayString =
-// "'abc\\u0027def';\n";
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-
-//public void testAA_3() {
-// String str =
-// "package p; \n" +
-// "import something; \n" +
-// "import p2.; \n" +
-// "public class AA {\n" +
-// " void foo() {\n" +
-// " int maxUnits = 0;\n" +
-// " for (int i = 0; \n" +
-// " i < maxUnits; \n" +
-// " i++) {\n" +
-// " CompilationUnitResult unitResult = \n" +
-// " new CompilationUnitResult(\n" +
-// " null, \n" +
-// " i, \n" +
-// " maxUnits); \n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on call to constructor argument>";
-// String completeBehind = "i";
-// String expectedCompletionNodeToString = "<CompleteOnName:i>";
-// String completionIdentifier = "i";
-// String expectedReplacedSource = "i";
-// int cursorLocation = str.indexOf("i, ") + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import something;\n" +
-// "public class AA {\n" +
-// " public AA() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " int maxUnits;\n" +
-// " int i;\n" +
-// " {\n" +
-// " CompilationUnitResult unitResult = new CompilationUnitResult(null, <CompleteOnName:i>);\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testAA_4() {
-// String str =
-// "package p; \n" +
-// "import something; \n" +
-// "import p2.; \n" +
-// "public class AA {\n" +
-// " void foo() {\n" +
-// " int maxUnits = 0;\n" +
-// " for (int i = 0; \n" +
-// " i < maxUnits; \n" +
-// " i++) {\n" +
-// " CompilationUnitResult unitResult = \n" +
-// " new CompilationUnitResult(\n" +
-// " null, \n" +
-// " i, \n" +
-// " maxUnits); \n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on constructor call argument>";
-// String completeBehind = "max";
-// String expectedCompletionNodeToString = "<CompleteOnName:max>";
-// String completionIdentifier = "max";
-// String expectedReplacedSource = "maxUnits";
-// int cursorLocation = str.indexOf("maxUnits); ") + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import something;\n" +
-// "public class AA {\n" +
-// " public AA() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " int maxUnits;\n" +
-// " int i;\n" +
-// " {\n" +
-// " CompilationUnitResult unitResult = new CompilationUnitResult(null, i, <CompleteOnName:max>);\n" +
-// " }\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testAB_1FHU9LU() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FHU9LU\n" +
-// " */\n" +
-// "class SuperClass {\n" +
-// " static void eFooStatic() {\n" +
-// " }\n" +
-// " void eFoo() {\n" +
-// " }\n" +
-// "}\n" +
-// "public class AB\n" +
-// " extends SuperClass {\n" +
-// " void eBar() {\n" +
-// " super.eFoo();\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on methods/fields from super class>";
-// String completeBehind = "super.";
-// String expectedCompletionNodeToString = "<CompleteOnMemberAccess:super.>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "super.";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "class SuperClass {\n" +
-// " SuperClass() {\n" +
-// " }\n" +
-// " static void eFooStatic() {\n" +
-// " }\n" +
-// " void eFoo() {\n" +
-// " }\n" +
-// "}\n" +
-// "public class AB extends SuperClass {\n" +
-// " public AB() {\n" +
-// " }\n" +
-// " void eBar() {\n" +
-// " <CompleteOnMemberAccess:super.>;\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testAC_1FJ8D9Z_1() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FJ8D9Z\n" +
-// " */\n" +
-// "import java.io.*;\n" +
-// "public class AC {\n" +
-// " AC() {\n" +
-// " }\n" +
-// " AC(int i) {\n" +
-// " }\n" +
-// " AC(int i, String s) {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new AC(new File(\n" +
-// " new java\n" +
-// " .util\n" +
-// " .Vector(}\n" +
-// "}\n";
-//
-// String testName = "<complete on constructor argument>";
-// String completeBehind = "new AC(";
-// String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new AC()>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import java.io.*;\n" +
-// "public class AC {\n" +
-// " AC() {\n" +
-// " }\n" +
-// " AC(int i) {\n" +
-// " }\n" +
-// " AC(int i, String s) {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " <CompleteOnAllocationExpression:new AC()>;\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testAC_1FJ8D9Z_2() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FJ8D9Z\n" +
-// " */\n" +
-// "import java.io.*;\n" +
-// "public class AC {\n" +
-// " AC() {\n" +
-// " }\n" +
-// " AC(int i) {\n" +
-// " }\n" +
-// " AC(int i, String s) {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new AC(new File(\n" +
-// " new java\n" +
-// " .util\n" +
-// " .Vector(}\n" +
-// "}\n";
-//
-// String testName = "<complete on constructor argument>";
-// String completeBehind = "new File(";
-// String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new File()>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import java.io.*;\n" +
-// "public class AC {\n" +
-// " AC() {\n" +
-// " }\n" +
-// " AC(int i) {\n" +
-// " }\n" +
-// " AC(int i, String s) {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " <CompleteOnAllocationExpression:new File()>;\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testAC_1FJ8D9Z_3() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FJ8D9Z\n" +
-// " */\n" +
-// "import java.io.*;\n" +
-// "public class AC {\n" +
-// " AC() {\n" +
-// " }\n" +
-// " AC(int i) {\n" +
-// " }\n" +
-// " AC(int i, String s) {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new AC(new File(\n" +
-// " new java.util.Vector(}\n" +
-// "}\n";
-//
-// String testName = "<complete on constructor argument>";
-// String completeBehind = "new java.util.Vector(";
-// String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new java.util.Vector()>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import java.io.*;\n" +
-// "public class AC {\n" +
-// " AC() {\n" +
-// " }\n" +
-// " AC(int i) {\n" +
-// " }\n" +
-// " AC(int i, String s) {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " <CompleteOnAllocationExpression:new java.util.Vector()>;\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-public void testB() {
- String str =
- "function B() {\n" +
- " var o = new Object \n}\n";
-
- String testName = "<complete on type into type creation>";
- String completeBehind = "new Object";
- String expectedCompletionNodeToString = "<CompleteOnName:Object>";
- String completionIdentifier = "Object";
- String expectedReplacedSource = "Object";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function B() {\n" +
- " var o = new <CompleteOnType:Object>;\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-//public void testBA_1() {
-// String str =
-// "package p; \n" +
-// "public class BA {\n" +
-// " void foo() {\n" +
-// " java.util.Vector v2;\n" +
-// " java.util.Vector v1;\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on package name>";
-// String completeBehind = "java.";
-// String expectedCompletionNodeToString = "<CompleteOnName:java.>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "java.";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "public class BA {\n" +
-// " public BA() {\n" +
-//
-// " }\n" +
-// " void foo() {\n" +
-// " <CompleteOnName:java.>;\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testBA_2() {
-// String str =
-// "package p; \n" +
-// "public class BA {\n" +
-// " void foo() {\n" +
-// " java.util.Vector v2;\n" +
-// " java.util.Vector v1;\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on package contents>";
-// String completeBehind = "java.util.";
-// String expectedCompletionNodeToString = "<CompleteOnName:java.util.>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "java.util.";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "public class BA {\n" +
-// " public BA() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " <CompleteOnName:java.util.>;\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-public void testBB_1FHJ8H9() {
- String str =
- "function bar() {\n" +
- " z }\n" +
- "\n";
-
- String testName = "<complete on method/field from implicit method call>";
- String completeBehind = "z";
- String expectedCompletionNodeToString = "<CompleteOnName:z>";
- String completionIdentifier = "z";
- String expectedReplacedSource = "z";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function bar() {\n" +
- " <CompleteOnName:z>;\n" +
- "}" +
- "\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-//public void testBC_1FJ4GSG_1() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FJ4GSG\n" +
-// " */\n" +
-// "import java.util.Vector;\n" +
-// "public class BC {\n" +
-// " int Value1 = 0;\n" +
-// " interface Constants {\n" +
-// " int OK = 1;\n" +
-// " int CANCEL = 2;\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " Vector v = \n" +
-// " new Vector(\n" +
-// " Value1, \n" +
-// " BC.Constants.OK\n" +
-// " | BC.Constants.CANCEL); \n" +
-// " Object ans = v.elementAt(1);\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on member type>";
-// String completeBehind = "BC.";
-// String expectedCompletionNodeToString = "<CompleteOnName:BC.>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "BC.";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import java.util.Vector;\n" +
-// "public class BC {\n" +
-// " interface Constants {\n" +
-// " int OK;\n" +
-// " int CANCEL;\n" +
-// " <clinit>() {\n" +
-// " }\n" +
-// " }\n" +
-// " int Value1;\n" +
-// " public BC() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " Vector v = new Vector(Value1, <CompleteOnName:BC.>);\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testBC_1FJ4GSG_2() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FJ4GSG\n" +
-// " */\n" +
-// "import java.util.Vector;\n" +
-// "public class BC {\n" +
-// " int Value1 = 0;\n" +
-// " interface Constants {\n" +
-// " int OK = 1;\n" +
-// " int CANCEL = 2;\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " Vector v = \n" +
-// " new Vector(\n" +
-// " Value1, \n" +
-// " BC.Constants.OK\n" +
-// " | BC.Constants.CANCEL); \n" +
-// " Object ans = v.elementAt(1);\n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on member type method/field>";
-// String completeBehind = "| BC.Constants.";
-// String expectedCompletionNodeToString = "<CompleteOnName:BC.Constants.>";
-// String completionIdentifier = "";
-// String expectedReplacedSource = "BC.Constants.";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import java.util.Vector;\n" +
-// "public class BC {\n" +
-// " interface Constants {\n" +
-// " int OK;\n" +
-// " int CANCEL;\n" +
-// " <clinit>() {\n" +
-// " }\n" +
-// " }\n" +
-// " int Value1;\n" +
-// " public BC() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " Vector v = (BC.Constants.OK | <CompleteOnName:BC.Constants.>);\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-public void testMsgSend() {
- String str =
- " function foo() {\n"+
- " var removed = 0;\n"+
- " toto(Test.vvv).titi(removed);\n"+
- " }\n";
-
- String testName = "<complete on method call>";
- String completeBehind = "removed";
- String expectedCompletionNodeToString = "<CompleteOnName:removed>";
- String completionIdentifier = "removed";
- String expectedReplacedSource = "removed";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var removed = 0;\n" +
- " toto(Test.vvv).titi(<CompleteOnName:removed>);\n" +
- "}" +
- "\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testMsgSend2() {
- String str =
- " abc.titi();\n"+
- "";
-
- String testName = "<complete on method call 2>";
- String completeBehind = "titi";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:abc.titi()>";
- String completionIdentifier = "titi";
- String expectedReplacedSource = "titi()";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "<CompleteOnMessageSend:abc.titi()>;" +
- "\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testMsgSend3() {
- String str =
- " function foo() {\n"+
- " var removed = 0;\n"+
- " toto(Test.vvv).titi(removed);\n"+
- " }\n";
-
- String testName = "<complete on method call 3>";
- String completeBehind = "titi";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:toto(Test.vvv).titi(removed)>";
- String completionIdentifier = "titi";
- String expectedReplacedSource = "titi(removed)";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var removed = 0;\n" +
- " <CompleteOnMessageSend:toto(Test.vvv).titi(removed)>;\n" +
- "}" +
- "\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-public void testBC_1FJ4GSG_3() {
- String str =
- " function foo() {\n" +
- " var v = \n" +
- " new Vector();\n" +
- " var ans = v.elementAt(1);\n" +
- " }\n" +
- "\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "v.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:v.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "v.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var v = new Vector();\n" +
- " var ans = <CompleteOnMemberAccess:v.>;\n" +
- "}" +
- "\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-public void testC() {
- String str =
- "function foo() {\n" +
- " var string = n;\n" +
- " }\n" +
- "\n";
-
- String completeBehind = "= n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var string = <CompleteOnName:n>;\n" +
- "}\n";
- String expectedReplacedSource = "n";
- String testName = "<complete on local variable initializer>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testCA_1FGPJQZ() {
- String str =
- " function moo() {\n" +
- " unknownField.}\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "unknownField.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:unknownField.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "function moo() {\n" +
- " <CompleteOnMemberAccess:unknownField.>;\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testCB_1FHSKQ9_1() {
- String str =
- " function foo() {\n" +
- " var i = 0;\n" +
- " var tab1 = 0;\n" +
- " System.out.println(\n" +
- " \" \" + (i + 1)); \n" +
- "}\n";
-
- String testName = "<complete on method call argument>";
- String completeBehind = "+ (i";
- String expectedCompletionNodeToString = "<CompleteOnName:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " var i = 0;\n" +
- " var tab1 = 0;\n" +
- " System.out.println((\" \" + (<CompleteOnName:i> + 1)));\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testCB_1FHSKQ9_2() {
- String str =
- " function foo() {\n" +
- " var i = 0;\n" +
- " System.out.println(\n" +
- " \" \" + (i + 1)); \n" +
- "}\n";
-
- String completeBehind = "i + 1";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedUnitDisplayString = null;
- String expectedReplacedSource = NONE;
- String testName = "<complete on digit into method call argument>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_NUMBER);
- }
-}
-//public void testCC_1FJ64I9() {
-// String str =
-// "package p; \n" +
-// "/**\n" +
-// " * 1FJ64I9\n" +
-// " */\n" +
-// "class CCHelper {\n" +
-// " class Member1 {\n" +
-// " }\n" +
-// " class Member2 {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " }\n" +
-// "}\n" +
-// "public class CC {\n" +
-// " void foo() {\n" +
-// " new CCHelper()\n" +
-// " .new CCHelper()\n" +
-// " .new M }\n" +
-// "}\n";
-//
-// String testName = "<complete on qualified member type>";
-// String completeBehind = ".new M";
-// String expectedCompletionNodeToString = "<CompleteOnType:M>";
-// String completionIdentifier = "M";
-// String expectedReplacedSource = "M";
-// int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "class CCHelper {\n" +
-// " class Member1 {\n" +
-// " Member1() {\n" +
-// " }\n" +
-// " }\n" +
-// " class Member2 {\n" +
-// " Member2() {\n" +
-// " }\n" +
-// " }\n" +
-// " CCHelper() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " }\n" +
-// "}\n" +
-// "public class CC {\n" +
-// " public CC() {\n" +
-// " }\n" +
-// " void foo() {\n" +
-// " new CCHelper().new CCHelper().new <CompleteOnType:M>();\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-//public void testD_1() {
-// String str =
-// "package p; \n" +
-// "import java.util.*;\n" +
-// "public class D {\n" +
-// " static int i;\n" +
-// " static {\n" +
-// " i = 5;\n" +
-// " }\n" +
-// " public int j;\n" +
-// " Vector a = new Vector();\n" +
-// " void foo(String s) {\n" +
-// " String string = null;\n" +
-// " int soso;\n" +
-// " float f;\n" +
-// " string.regionMatches(\n" +
-// " 0, \n" +
-// " \"\", \n" +
-// " 0, \n" +
-// " 0); \n" +
-// " }\n" +
-// "}\n";
-//
-// String testName = "<complete on variable into type initializer>";
-// String completeBehind = "i";
-// String expectedCompletionNodeToString = "<CompleteOnName:i>";
-// String completionIdentifier = "i";
-// String expectedReplacedSource = "i";
-// int cursorLocation = str.indexOf("i = 5;") + completeBehind.length() - 1;
-// String expectedUnitDisplayString =
-// "package p;\n" +
-// "import java.util.*;\n" +
-// "public class D {\n" +
-// " static int i;\n" +
-// " static {\n" +
-// " <CompleteOnName:i>;\n" +
-// " }\n" +
-// " public int j;\n" +
-// " Vector a;\n" +
-// " <clinit>() {\n" +
-// " }\n" +
-// " public D() {\n" +
-// " }\n" +
-// " void foo(String s) {\n" +
-// " }\n" +
-// "}\n";
-//
-// checkMethodParse(
-// str.toCharArray(),
-// cursorLocation,
-// expectedCompletionNodeToString,
-// expectedUnitDisplayString,
-// completionIdentifier,
-// expectedReplacedSource,
-// testName);
-//}
-public void testD_2() {
- String str =
- " var a = new Vector();\n" +
- " function foo(s) {\n" +
- " var string = null;\n" +
- " var soso;\n" +
- " var f;\n" +
- " string.regionMatches(\n" +
- " 0, \n" +
- " \"\", \n" +
- " 0, \n" +
- " 0); \n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "string.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:string.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "string.";
- String expectedUnitDisplayString =
- "var a = new Vector();\n" +
- "function foo(s) {\n" +
- " var string = null;\n" +
- " var soso;\n" +
- " var f;\n" +
- " <CompleteOnMemberAccess:string.>;\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testD_2b() {
- String str =
- " function foo(s) {\n" +
- " foo(string.regionMatches);\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "string.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:string.>";
- String completionIdentifier = "string.";
- String expectedReplacedSource = "regionMatches";
- String expectedUnitDisplayString =
- "function foo(s) {\n" +
- " foo(<CompleteOnMemberAccess:string.>);\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testD_2c() {
- String str =
- " var obj= {\n" +
- " a: string.regionMatches\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "string.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:string.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "regionMatches";
- String expectedUnitDisplayString =
- "var obj = {\n" +
- " a : <CompleteOnMemberAccess:string.>\n" +
- "};\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testDA_1() {
- String str =
- "package p; \n" +
- "public class DA {\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into anonymous declaration>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "v";
- int cursorLocation = str.indexOf("v }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DA {\n" +
- " public DA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " () {\n" +
- " }\n" +
- " protected void runTest() {\n" +
- " Vector v11111;\n" +
- " <CompleteOnName:v>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testDA_2() {
- String str =
- "package p; \n" +
- "public class DA {\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "protected v";
- String expectedCompletionNodeToString = "<CompleteOnType:v>";
- String completionIdentifier = "v";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DA {\n" +
- " public DA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " <CompleteOnType:v>;\n" +
- " () {\n" +
- " }\n" +
- " runTest() {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
- String expectedReplacedSource = "void";
- String testName = "<complete on return type into anonymous declaration>";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testDA_3() {
- String str =
- "package p; \n" +
- "public class DA {\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method selector into anonymous declaration>";
- String completeBehind = "r";
- String expectedCompletionNodeToString = "<CompleteOnFieldName:void r>;";
- String completionIdentifier = "r";
- String expectedReplacedSource = "runTest";
- int cursorLocation = str.indexOf("runTest") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DA {\n" +
- " public DA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " <CompleteOnFieldName:void r>;\n" +
- " {\n" +
- " }\n" +
- " () {\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testDA_4() {
- String str =
- "package p; \n" +
- "public class DA {\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable type into anonymous declaration>";
- String completeBehind = "V";
- String expectedCompletionNodeToString = "<CompleteOnName:V>";
- String completionIdentifier = "V";
- String expectedReplacedSource = "Vector";
- int cursorLocation = str.indexOf("Vector v11111") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DA {\n" +
- " public DA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " () {\n" +
- " }\n" +
- " protected void runTest() {\n" +
- " <CompleteOnName:V>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testDA_5() {
- String str =
- "package p; \n" +
- "public class DA {\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local type into anonymous declaration>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "v";
- int cursorLocation = str.indexOf("v }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DA {\n" +
- " public DA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new TestCase(\"error\") {\n" +
- " () {\n" +
- " }\n" +
- " protected void runTest() {\n" +
- " Vector v11111;\n" +
- " <CompleteOnName:v>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testDB_1FHSLDR() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLDR\n" +
- " */\n" +
- "public class DB {\n" +
- " void foo() {\n" +
- " try {\n" +
- " System.out.println(\"\");\n" +
- " }\n" +
- " fi }\n" +
- "}\n";
-
- String testName = "<complete on finally keyword>";
- String completeBehind = "fi";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fi>";
- String completionIdentifier = "fi";
- String expectedReplacedSource = "fi";
- int cursorLocation = str.indexOf("fi }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DB {\n" +
- " public DB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnKeyword:fi>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testDC_1FJJ0JR_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJJ0JR\n" +
- " */\n" +
- "public class DC\n" +
- " extends ModelChangeOperation {\n" +
- " ISec public SetSecondarySourceOperation(\n" +
- " ISecondarySourceContainer element, \n" +
- " VersionID id) {\n" +
- " }\n" +
- " protected abstract void doExecute(IProgressMonitor monitor)\n" +
- " throws OperationFailedException {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method return type>";
- String completeBehind = "ISec";
- String expectedCompletionNodeToString = "<CompleteOnType:ISec>";
- String completionIdentifier = "ISec";
- String expectedReplacedSource = "ISec";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class DC extends ModelChangeOperation {\n" +
- " <CompleteOnType:ISec>;\n" +
- " public DC() {\n" +
- " }\n" +
- " public SetSecondarySourceOperation(ISecondarySourceContainer element, VersionID id) {\n" +
- " }\n" +
- " protected abstract void doExecute(IProgressMonitor monitor) throws OperationFailedException;\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testE_1FG1YDS_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YDS\n" +
- " */\n" +
- "public class E {\n" +
- " {\n" +
- " new Y()\n" +
- " }\n" +
- " {\n" +
- " new Y().}\n" +
- " class Y\n" +
- " extends java.util.Vector {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on type into type creation>";
- String completeBehind = "Y";
- String expectedCompletionNodeToString = "<CompleteOnType:Y>";
- String completionIdentifier = "Y";
- String expectedReplacedSource = "Y";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class E {\n" +
- " class Y extends java.util.Vector {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " new <CompleteOnType:Y>();\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " public E() {\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("Y()\n") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testE_1FG1YDS_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YDS\n" +
- " */\n" +
- "public class E {\n" +
- " {\n" +
- " new Y()\n" +
- " }\n" +
- " {\n" +
- " new Y().}\n" +
- " class Y\n" +
- " extends java.util.Vector {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on implicit method call into intializer>";
- String completeBehind = "new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class E {\n" +
- " class Y extends java.util.Vector {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " {\n" +
- " <CompleteOnMemberAccess:new Y().>;\n" +
- " }\n" +
- " public E() {\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testE_1FG1YDS_3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YDS\n" +
- " */\n" +
- "public class E {\n" +
- " {\n" +
- " new Y()\n" +
- " }\n" +
- " {\n" +
- " new Y().}\n" +
- " class Y\n" +
- " extends java.util.Vector {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on extend type>";
- String completeBehind = "java.util.";
- String expectedCompletionNodeToString = "<CompleteOnClass:java.util.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "java.util.Vector";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class E {\n" +
- " class Y extends <CompleteOnClass:java.util.> {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " {\n" +
- " }\n" +
- " public E() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testEA_1() {
- String str =
- "package p; \n" +
- "public class EA {\n" +
- " void foo() {\n" +
- " try {\n" +
- " throw new Error();\n" +
- " } catch (Exception eeee) {\n" +
- " eeee.}\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on catch block exception type declaration>";
- String completeBehind = "E";
- String expectedCompletionNodeToString = "<CompleteOnException:E>";
- String completionIdentifier = "E";
- String expectedReplacedSource = "Exception";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class EA {\n" +
- " public EA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnException:E>;\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("Exception eeee") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testEA_2() {
- String str =
- "package p; \n" +
- "public class EA {\n" +
- " void foo() {\n" +
- " try {\n" +
- " throw new Error();\n" +
- " } catch (Exception eeee) {\n" +
- " eeee.}\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of thrown exception into catch block>";
- String completeBehind = "eeee.";
- String expectedCompletionNodeToString = "<CompleteOnName:eeee.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "eeee.";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class EA {\n" +
- " public EA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception eeee;\n" +
- " <CompleteOnName:eeee.>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testEB_1FI74S3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FI74S3\n" +
- " */\n" +
- "public class EB {\n" +
- " int[] table;\n" +
- " void foo() {\n" +
- " int x = table.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "table.";
- String expectedCompletionNodeToString = "<CompleteOnName:table.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "table.";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class EB {\n" +
- " int[] table;\n" +
- " public EB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = <CompleteOnName:table.>;\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testEC_1FSBZ2Y() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSBZ2Y\n" +
- " */\n" +
- "class EC {\n" +
- " void foo() {\n" +
- " EC\n" +
- " }\n" +
- "}\n" +
- "class ECOtherTopLevel {\n" +
- "}\n";
-
- String testName = "<complete on local variable decaration type>";
- String completeBehind = "EC";
- String expectedCompletionNodeToString = "<CompleteOnName:EC>";
- String completionIdentifier = "EC";
- String expectedReplacedSource = "EC";
- String expectedUnitDisplayString =
- "package p;\n" +
- "class EC {\n" +
- " EC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:EC>;\n" +
- " }\n" +
- "}\n" +
- "class ECOtherTopLevel {\n" +
- " ECOtherTopLevel() {\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("EC\n") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testF() {
- String str =
- "package p; \n" +
- "public class F {\n" +
- " void bar() {\n" +
- " }\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " ba }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field explicit access>";
- String completeBehind = "ba";
- String expectedCompletionNodeToString = "<CompleteOnName:ba>";
- String completionIdentifier = "ba";
- String expectedReplacedSource = "ba";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class F {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:ba>;\n" +
- " }\n" +
- " }\n" +
- " public F() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("ba }") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testFA_1() {
- String str =
- "package p; \n" +
- "public class FA {\n" +
- " byte value;\n" +
- " public float foo() {\n" +
- " return (float) value;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on cast expression type>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "float";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class FA {\n" +
- " byte value;\n" +
- " public FA() {\n" +
- " }\n" +
- " public float foo() {\n" +
- " return <CompleteOnName:f>;\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("float)") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testFA_2() {
- String str =
- "package p; \n" +
- "public class FA {\n" +
- " byte value;\n" +
- " public float foo() {\n" +
- " return (float) value; \n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on returned value>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "value";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class FA {\n" +
- " byte value;\n" +
- " public FA() {\n" +
- " }\n" +
- " public float foo() {\n" +
- " (float) <CompleteOnName:v>;\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("value; \n") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testFB_1FI74S3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FI74S3\n" +
- " */\n" +
- "public class FB {\n" +
- " int[] table;\n" +
- " void foo() {\n" +
- " int x = table[1].}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array element>";
- String completeBehind = "table[1].";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:table[1].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class FB {\n" +
- " int[] table;\n" +
- " public FB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = <CompleteOnMemberAccess:table[1].>;\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testFC_1FSBZ9B() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSBZ9B\n" +
- " */\n" +
- "class FC {\n" +
- " UNKOWNTYPE field;\n" +
- " void foo() {\n" +
- " f\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field implicit access>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class FC {\n" +
- " UNKOWNTYPE field;\n" +
- " FC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testG() {
- String str =
- "package p; \n" +
- "public class G {\n" +
- " int bar() {\n" +
- " }\n" +
- " class Y {\n" +
- " void foo(int b) {\n" +
- " return b }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on return value>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "b";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class G {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo(int b) {\n" +
- " return <CompleteOnName:b>;\n" +
- " }\n" +
- " }\n" +
- " public G() {\n" +
- " }\n" +
- " int bar() {\n" +
- " }\n" +
- "}\n";
-
- int cursorLocation = str.indexOf("b }") + completeBehind.length() - 1;
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testGA() {
- String str =
- "package p; \n" +
- "public class GA {\n" +
- " void foo(String s) {\n" +
- " String string = s;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable initializer>";
- String completeBehind = "s";
- String expectedCompletionNodeToString = "<CompleteOnName:s>";
- String completionIdentifier = "s";
- String expectedReplacedSource = "s";
- int cursorLocation = str.indexOf("s;") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class GA {\n" +
- " public GA() {\n" +
- " }\n" +
- " void foo(String s) {\n" +
- " String string = <CompleteOnName:s>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testGB_1FI74S3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FI74S3\n" +
- " */\n" +
- "public class GB {\n" +
- " String[] table;\n" +
- " void foo() {\n" +
- " int x = table[1].}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array element>";
- String completeBehind = "table[1].";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:table[1].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class GB {\n" +
- " String[] table;\n" +
- " public GB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = <CompleteOnMemberAccess:table[1].>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testGC_1FSHLHV_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSHLHV\n" +
- " */\n" +
- "public class GC {\n" +
- "public static void main(String[] args) {\n" +
- " Object l = new Object() {\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s = new String();\n" +
- " s.\n" +
- " try {\n" +
- " event.;\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "}\n";
-
- String testName = "<complete on anonymous declaration type>";
- String completeBehind = "O";
- String expectedCompletionNodeToString = "<CompleteOnType:O>";
- String completionIdentifier = "O";
- String expectedReplacedSource = "Object";
- int cursorLocation = str.indexOf("Object()") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class GC {\n" +
- " public GC() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Object l = new <CompleteOnType:O>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testGC_1FSHLHV_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSHLHV\n" +
- " */\n" +
- "public class GC {\n" +
- "public static void main(String[] args) {\n" +
- " Object l = new Object() {\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s = new String();\n" +
- " s.\n" +
- " try {\n" +
- " event.;\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable into anonymous declaration>";
- String completeBehind = "s.";
- String expectedCompletionNodeToString = "<CompleteOnName:s.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "s.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class GC {\n" +
- " public GC() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Object l;\n" +
- " new Object() {\n" +
- " () {\n" +
- " }\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s;\n" +
- " <CompleteOnName:s.>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testGC_1FSHLHV_3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSHLHV\n" +
- " */\n" +
- "public class GC {\n" +
- "public static void main(String[] args) {\n" +
- " Object l = new Object() {\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s = new String();\n" +
- " s.\n" +
- " try {\n" +
- " event.;\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "event.";
- String expectedCompletionNodeToString = "<CompleteOnName:event.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "event.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class GC {\n" +
- " public GC() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Object l;\n" +
- " new Object() {\n" +
- " () {\n" +
- " }\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s;\n" +
- " {\n" +
- " <CompleteOnName:event.>;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testGC_1FSHLHV_4() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSHLHV\n" +
- " */\n" +
- "public class GC {\n" +
- "public static void main(String[] args) {\n" +
- " Object l = new Object() {\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s = new String();\n" +
- " s.\n" +
- " try {\n" +
- " event.;\n" +
- " }\n" +
- " catch (Exception e) {\n" +
- " e.\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "}\n";
-
- String testName = "<complete on method/field of thrown exception into catch block into anonymous declaration>";
- String completeBehind = "e.";
- String expectedCompletionNodeToString = "<CompleteOnName:e.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "e.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class GC {\n" +
- " public GC() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " Object l;\n" +
- " new Object() {\n" +
- " () {\n" +
- " }\n" +
- " public void handleEvent(String[] event) {\n" +
- " String s;\n" +
- " {\n" +
- " Exception e;\n" +
- " <CompleteOnName:e.>;\n" +
- " }\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testH0() {
- String str =
- " function foo() {\n" +
- " whil \n" +
- "\n";
-
- String testName = "<complete on while keyword argument>";
- String completeBehind = "whil";
- String expectedCompletionNodeToString = "<CompleteOnName:whil>";
- String completionIdentifier = "whil";
- String expectedReplacedSource = "whil";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "function foo() {\n" +
- " <CompleteOnName:whil>;\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-
-
-public void testH() {
- String str =
- " function foo(bbbb) {\n" +
- " while (Xbm }\n" +
- " function bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on while keyword argument>";
- String completeBehind = "Xbm";
- String expectedCompletionNodeToString = "<CompleteOnName:Xbm>";
- String completionIdentifier = "Xbm";
- String expectedReplacedSource = "Xbm";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class H {\n" +
- " public H() {\n" +
- " }\n" +
- " function foo( bbbb) {\n" +
- " <CompleteOnName:Xbm>;\n" +
- " }\n" +
- " function bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testHA_1() {
- String str =
- "package p; \n" +
- "public class HA {\n" +
- " void foo() {\n" +
- " x.y.Z[] field1; \n" +
- " field1[1].}\n" +
- "}\n";
-
- String testName = "<complete on package member type>";
- String completeBehind = "x.y.";
- String expectedCompletionNodeToString = "<CompleteOnName:x.y.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "x.y.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class HA {\n" +
- " public HA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:x.y.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testHA_2() {
- String str =
- "package p; \n" +
- "public class HA {\n" +
- " void foo() {\n" +
- " x.y.Z[] field1; \n" +
- " field1[1].}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array element>";
- String completeBehind = "field1[1].";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:field1[1].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class HA {\n" +
- " public HA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " x.y.Z[] field1;\n" +
- " <CompleteOnMemberAccess:field1[1].>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testHB_1FHSLDR() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLDR\n" +
- " */\n" +
- "public class HB {\n" +
- " void foo() {\n" +
- " for (; i < totalUnits; i++) {\n" +
- " unit = unitsToProcess[i];\n" +
- " try {\n" +
- " if (options.verbose) {\n" +
- " System.out.println(\n" +
- " \"process \"\n" +
- " + (i + 1)\n" +
- " + \"/\"\n" +
- " + totalUnits\n" +
- " + \" : \"\n" +
- " + unitsToProcess[i]\n" +
- " .sourceFileName()); \n" +
- " }\n" +
- " process(unit, i);\n" +
- " }\n" +
- " fi }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on finally keyword>";
- String completeBehind = "fi";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:fi>";
- String completionIdentifier = "fi";
- String expectedReplacedSource = "fi";
- int cursorLocation = str.indexOf("fi }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class HB {\n" +
- " public HB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnKeyword:fi>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testHC_1FMPYO3_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FMPYO3\n" +
- " */\n" +
- "class HC {\n" +
- " HC(Object o){}\n" +
- " void foo(){\n" +
- " HC a = new HC(new Object()).\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new HC(new Object()).";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new HC(new Object()).>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class HC {\n" +
- " HC(Object o) {\n" +
- " }\n" +
- " void foo() {\n" +
- " HC a = <CompleteOnMemberAccess:new HC(new Object()).>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testHC_1FMPYO3_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FMPYO3\n" +
- " */\n" +
- "class HC {\n" +
- " HC(Object o){}\n" +
- " void foo(){\n" +
- " A a = new A(new Object()).\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object of nested object creation declaration>";
- String completeBehind = "O";
- String expectedCompletionNodeToString = "<CompleteOnType:O>";
- String completionIdentifier = "O";
- String expectedReplacedSource = "Object";
- int cursorLocation = str.indexOf("Object()") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class HC {\n" +
- " HC(Object o) {\n" +
- " }\n" +
- " void foo() {\n" +
- " A a = new A(new <CompleteOnType:O>());\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testI() {
- String str =
- "package p; \n" +
- "public class I {\n" +
- " Component }\n";
-
- String testName = "<complete on incomplete field declaration type>";
- String completeBehind = "C";
- String expectedCompletionNodeToString = "<CompleteOnType:C>";
- String completionIdentifier = "C";
- String expectedReplacedSource = "Component";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class I {\n" +
- " <CompleteOnType:C>;\n" +
- " public I() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testIA_1FGNBPR_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGNBPR\n" +
- " */\n" +
- "public class IA {\n" +
- " void foo1() {\n" +
- " label1 : while (true) {\n" +
- " class A {\n" +
- " void foo2() {\n" +
- " label2 : while (true) {\n" +
- " break la }\n" +
- " }\n" +
- " }\n" +
- " A a = new A();\n" +
- " break la }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on label name>";
- String completeBehind = "la";
- String expectedCompletionNodeToString = "break <CompleteOnLabel:la>;";
- String completionIdentifier = "la";
- String expectedReplacedSource = "la";
- int cursorLocation = str.indexOf("la }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class IA {\n" +
- " public IA() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " {\n" +
- " class A {\n" +
- " A() {\n" +
- " }\n" +
- " void foo2() {\n" +
- " break <CompleteOnLabel:la>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testIA_1FGNBPR_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGNBPR\n" +
- " */\n" +
- "public class IA {\n" +
- " void foo1() {\n" +
- " label1 : while (true) {\n" +
- " class A {\n" +
- " void foo2() {\n" +
- " label2 : while (true) {\n" +
- " break la }\n" +
- " }\n" +
- " }\n" +
- " A a = new A();\n" +
- " break la }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on label name>";
- String completeBehind = "la";
- String expectedCompletionNodeToString = "break <CompleteOnLabel:la>;";
- String completionIdentifier = "la";
- String expectedReplacedSource = "la";
- int cursorLocation = str.indexOf("la }", str.indexOf("la }") + 1) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class IA {\n" +
- " public IA() {\n" +
- " }\n" +
- " void foo1() {\n" +
- " {\n" +
- " class A {\n" +
- " A() {\n" +
- " super();\n" + // could be optimized out ?
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- " }\n" +
- " A a;\n" +
- " break <CompleteOnLabel:la>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testIB() {
- String str =
- "package p; \n" +
- "public class IB {\n" +
- " UnknownFieldTYPE field;\n" +
- " void foo() {\n" +
- " field.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of field of unkown type>";
- String completeBehind = "field.";
- String expectedCompletionNodeToString = "<CompleteOnName:field.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "field.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class IB {\n" +
- " UnknownFieldTYPE field;\n" +
- " public IB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:field.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testIC_1FMGUPR() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FMGUPR\n" +
- " */\n" +
- "public class IC {\n" +
- " void foo(){\n" +
- " new String().toString().\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on multiple method/field call>";
- String completeBehind = "new String().toString().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String().toString().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class IC {\n" +
- " public IC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new String().toString().>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testJ() {
- String str =
- "package p; \n" +
- "public class J {\n" +
- " int foo1()[void foo2() int i;\n" +
- " void foo3() {\n" +
- " f }\n";
-
- String testName = "<complete on method/field access into corrupted method declaration>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class J {\n" +
- " public J() {\n" +
- " }\n" +
- " int foo1() {\n" +
- " }\n" +
- " void foo2() {\n" +
- " }\n" +
- " void foo3() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testJA_1FGQVW2_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGQVW2\n" +
- " */\n" +
- "public class JA {\n" +
- " void foo() {\n" +
- " \"abc.txt\". 'a'.}\n" +
- "}\n";
-
- String testName = "<complete on string literal>";
- String completeBehind = "\"abc.txt\".";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:\"abc.txt\".>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class JA {\n" +
- " public JA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:\"abc.txt\".>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testJA_1FGQVW2_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGQVW2\n" +
- " */\n" +
- "public class JA {\n" +
- " void foo() {\n" +
- " \"abc.txt\". 'a'.}\n" +
- "}\n";
-
- String testName = "<complete on char literal>";
- String completeBehind = "'a'.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:'a'.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class JA {\n" +
- " public JA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:'a'.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testJB() {
- String str =
- "package p; \n" +
- "public class JB\n" +
- " extends UnknownSUPERCLASS\n" +
- " implements UnknownSUPERINTERFACE {\n" +
- " void foo() {\n" +
- " f }\n" +
- "}\n";
-
- String testName = "<complete into method declared into corrupted class declaration>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class JB extends UnknownSUPERCLASS implements UnknownSUPERINTERFACE {\n" +
- " public JB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testJC_1FLG1ZC() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FLG1ZC\n" +
- " */\n" +
- "public class JC {\n" +
- " void foo() {\n" +
- " new String ().\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation with dummy spaces>";
- String completeBehind = "new String ().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class JC {\n" +
- " public JC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new String().>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testK_1() {
- String str =
- "package p; \n" +
- "class Other {\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " java.io.File bbbb = \n" +
- " new File(\"c:\\abc.txt\"); \n" +
- " O bb bbbb.}\n" +
- "}\n";
-
-// str =
-// "public class K {\n" +
-// " void foo() {\n" +
-// " new X(\"c:abc.txt\"); \n" +
-// " O" +
-// " }\n" +
-// "}\n";
-
- String testName = "<complete on corrupted local variable declaration>";
- String completeBehind = " O";
- String expectedCompletionNodeToString = "<CompleteOnName:O>";
- String completionIdentifier = "O";
- String expectedReplacedSource = "O";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class Other {\n" +
- " Other() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public K() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " java.io.File bbbb;\n" +
- " <CompleteOnName:O>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testK_2() {
- String str =
- "package p; \n" +
- "class Other {\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " java.io.File bbbb = \n" +
- " new File(\"c:\\abc.txt\"); \n" +
- " O bb bbbb.}\n" +
- "}\n";
-
- String testName = "<complete on corrupted local variable declaration name>";
- String completeBehind = "bb";
- String expectedCompletionNodeToString = "<CompleteOnLocalName:O bb>;";
- String completionIdentifier = "bb";
- String expectedReplacedSource = "bb";
- int cursorLocation = str.indexOf("bb bbbb.") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class Other {\n" +
- " Other() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public K() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " java.io.File bbbb;\n" +
- " <CompleteOnLocalName:O bb>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testK_3() {
- String str =
- "package p; \n" +
- "class Other {\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " java.io.File bbbb = \n" +
- " new File(\"c:\\abc.txt\"); \n" +
- " O bb bbbb.}\n" +
- "}\n";
-
- String testName = "<complete on corrupted local variable declaration>";
- String completeBehind = "bbbb";
- String expectedCompletionNodeToString = "<CompleteOnName:bbbb>";
- String completionIdentifier = "bbbb";
- String expectedReplacedSource = "bbbb";
- int cursorLocation = str.indexOf("bbbb.}") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class Other {\n" +
- " Other() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public K() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " java.io.File bbbb;\n" +
- " O bb;\n" +
- " <CompleteOnName:bbbb>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testK_4() {
- String str =
- "package p; \n" +
- "class Other {\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " java.io.File bbbb = \n" +
- " new File(\"c:\\abc.txt\"); \n" +
- " O bb bbbb.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable with corrupted declaration>";
- String completeBehind = "bbbb.";
- String expectedCompletionNodeToString = "<CompleteOnName:bbbb.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "bbbb.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class Other {\n" +
- " Other() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n" +
- "public class K {\n" +
- " public K() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " java.io.File bbbb;\n" +
- " O bb;\n" +
- " <CompleteOnName:bbbb.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testKA_1FH5SU5() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FH5SU5\n" +
- " */\n" +
- "class KAHelper\n" +
- " extends java.util.Vector {\n" +
- "}\n" +
- "public class KA {\n" +
- " public int hashCode() {\n" +
- " return 10;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " KA a = new KA;\n" +
- " a.has }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "a.has";
- String expectedCompletionNodeToString = "<CompleteOnName:a.has>";
- String completionIdentifier = "has";
- String expectedReplacedSource = "a.has";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class KAHelper extends java.util.Vector {\n" +
- " KAHelper() {\n" +
- " }\n" +
- "}\n" +
- "public class KA {\n" +
- " public KA() {\n" +
- " }\n" +
- " public int hashCode() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " KA a;\n" +
- " <CompleteOnName:a.has>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testKB() {
- String str =
- "package p; \n" +
- "public class KB {\n" +
- " void foo()[i }\n" +
- "}\n";
-
- String testName = "<complete on corrupted method header>";
- String completeBehind = "void foo()[i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class KB {\n" +
- " public KB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testKC_1FLG1ZC() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FLG1ZC\n" +
- " */\n" +
- "import java.io.*;\n" +
- "public class KC {\n" +
- "private static char[] read(String fileName){\n" +
- " try {\n" +
- " File file = new File(fileName);\n" +
- " FileReader reader =\n" +
- " new FileReader(file);\n" +
- " int length;\n" +
- " char[] contents =\n" +
- " new char[\n" +
- " length =\n" +
- " (int) file.length()];\n" +
- " int len = 0;\n" +
- " int readSize = 0;\n" +
- " while ((readSize != -1)\n" +
- " && (len != length)) {\n" +
- " readSize = reader.read(\n" +
- " contents,\n" +
- " len,\n" +
- " length - len);\n" +
- " len += readSize;\n" +
- " }\n" +
- " reader. t\n";
-
- String testName = "<complete on method/field with dummy spaces>";
- String completeBehind = "reader. t";
- String expectedCompletionNodeToString = "<CompleteOnName:reader.t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "reader. t";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.io.*;\n" +
- "public class KC {\n" +
- " public KC() {\n" +
- " }\n" +
- " private static char[] read(String fileName) {\n" +
- " {\n" +
- " File file;\n" +
- " FileReader reader;\n" +
- " int length;\n" +
- " char[] contents;\n" +
- " int len;\n" +
- " int readSize;\n" +
- " <CompleteOnName:reader.t>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testL_1() {
- String str =
- "package p; \n" +
- "public class L {\n" +
- " void foo() {\n" +
- " x.y.Z[] field1, \n" +
- " field2; \n" +
- " field1.if (int[].class }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "field1.";
- String expectedCompletionNodeToString = "<CompleteOnName:field1.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "field1.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class L {\n" +
- " public L() {\n" +
- " }\n" +
- " void foo() {\n" +
- " x.y.Z[] field1;\n" +
- " x.y.Z[] field2;\n" +
- " <CompleteOnName:field1.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testL_2() {
- String str =
- "package p; \n" +
- "public class L {\n" +
- " void foo() {\n" +
- " x.y.Z[] field1, \n" +
- " field2; \n" +
- " field1.if (int[].class }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "int[].";
- String expectedCompletionNodeToString = "<CompleteOnClassLiteralAccess:int[].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "int[].";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class L {\n" +
- " public L() {\n" +
- " }\n" +
- " void foo() {\n" +
- " x.y.Z[] field1;\n" +
- " x.y.Z[] field2;\n" +
- " <CompleteOnClassLiteralAccess:int[].>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testL_3() {
- String str =
- "package p; \n" +
- "public class L {\n" +
- " void foo() {\n" +
- " x.y.Z[] field1, \n" +
- " field2; \n" +
- " field1.if (int[].class }\n" +
- "}\n";
-
- String testName = "<complete on argument of corrupted if statement>";
- String completeBehind = "int";
- String expectedCompletionNodeToString = "<CompleteOnName:int>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class L {\n" +
- " public L() {\n" +
- " }\n" +
- " void foo() {\n" +
- " x.y.Z[] field1;\n" +
- " x.y.Z[] field2;\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testLA_1FGLMOF() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGLMOF\n" +
- " */\n" +
- "public class LA {\n" +
- " void[] foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " f }\n" +
- "}\n";
-
- String testName = "<complete on method/field with corrupted method header>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class LA {\n" +
- " public LA() {\n" +
- " }\n" +
- " void[] foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testLB() {
- String str =
- "package p; \n" +
- "public class LB {\n" +
- " void foo() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " i }\n" +
- "}\n";
-
- String testName = "<complete on method/field with duplicate method declaration>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnName:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf("i }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class LB {\n" +
- " public LB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " <CompleteOnName:i>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testLC_1FLG1E2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FLG1E2\n" +
- " */\n" +
- "public class LC {\n" +
- " void foo() {\n" +
- " Object[] x = new Object[10];\n" +
- " x [1].\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array element with dummy spaces>";
- String completeBehind = "x [1].";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:x[1].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class LC {\n" +
- " public LC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] x;\n" +
- " <CompleteOnMemberAccess:x[1].>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testM_1FGGLMT() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGLMT\n" +
- " */\n" +
- "public class M {\n" +
- " class Member {\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " new Member().}\n" +
- "}\n" +
- "class MemberOfCU {\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit object creation>";
- String completeBehind = "new Member().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Member().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class M {\n" +
- " class Member {\n" +
- " Member() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " public M() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new Member().>;\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCU {\n" +
- " MemberOfCU() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMA_1() {
- String str =
- "package p; \n" +
- "public class MA {\n" +
- " class Member\n" +
- " extends java.util.Vector {\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " class MemberMember {\n" +
- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = \n" +
- " new MemberOfCUMA(); \n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " Membe }\n" +
- " void foobar() {\n" +
- " new Member().}\n" +
- " class Member2 {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- "}\n";
-
- String testName = "<complete on local variable declaration type>";
- String completeBehind = "Membe";
- String expectedCompletionNodeToString = "<CompleteOnName:Membe>";
- String completionIdentifier = "Membe";
- String expectedReplacedSource = "Membe";
- int cursorLocation = str.indexOf("Membe }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MA {\n" +
- " class Member extends java.util.Vector {\n" +
- " class MemberMember {\n" +
- " MemberMember() {\n" +
- " }\n" +
- " void fooMemberMember() {\n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " MemberMember2() {\n" +
- " }\n" +
- " }\n" +
- " Member() {\n" +
- " }\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " public MA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:Membe>;\n" +
- " }\n" +
- " void foobar() {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- " MemberOfCUMA() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMA_2() {
- String str =
- "package p; \n" +
- "public class MA {\n" +
- " class Member\n" +
- " extends java.util.Vector {\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " class MemberMember {\n" +
- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = \n" +
- " new MemberOfCUMA(); \n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " Membe }\n" +
- " void foobar() {\n" +
- " new Member().}\n" +
- " class Member2 {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- "}\n";
-
- String testName = "<complete on object creation type>";
- String completeBehind = "MemberOfCU";
- String expectedCompletionNodeToString = "<CompleteOnType:MemberOfCU>";
- String completionIdentifier = "MemberOfCU";
- String expectedReplacedSource = "MemberOfCUMA";
- int cursorLocation = str.indexOf("MemberOfCUMA();") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MA {\n" +
- " class Member extends java.util.Vector {\n" +
- " class MemberMember {\n" +
- " MemberMember() {\n" +
- " }\n" +
- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = new <CompleteOnType:MemberOfCU>();\n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " MemberMember2() {\n" +
- " }\n" +
- " }\n" +
- " Member() {\n" +
- " }\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " public MA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void foobar() {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- " MemberOfCUMA() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMA_3() {
- String str =
- "package p; \n" +
- "public class MA {\n" +
- " class Member\n" +
- " extends java.util.Vector {\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " class MemberMember {\n" +
- " void fooMemberMember() {\n" +
- " MemberOfCUMA m = \n" +
- " new MemberOfCUMA(); \n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " }\n" +
- " }\n" +
- " void foo() {\n" +
- " Membe }\n" +
- " void foobar() {\n" +
- " new Member().}\n" +
- " class Member2 {\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new Member().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Member().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MA {\n" +
- " class Member extends java.util.Vector {\n" +
- " class MemberMember {\n" +
- " MemberMember() {\n" +
- " }\n" +
- " void fooMemberMember() {\n" +
- " }\n" +
- " }\n" +
- " class MemberMember2 {\n" +
- " MemberMember2() {\n" +
- " }\n" +
- " }\n" +
- " Member() {\n" +
- " }\n" +
- " static void fooStaticMember() {\n" +
- " }\n" +
- " void fooMember() {\n" +
- " }\n" +
- " }\n" +
- " class Member2 {\n" +
- " Member2() {\n" +
- " }\n" +
- " }\n" +
- " public MA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void foobar() {\n" +
- " <CompleteOnMemberAccess:new Member().>;\n" +
- " }\n" +
- "}\n" +
- "class MemberOfCUMA {\n" +
- " MemberOfCUMA() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMB_1FHSLMQ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLMQ\n" +
- " */\n" +
- "public class MB {\n" +
- " void foo() {\n" +
- " try {\n" +
- " System.out.println(\"\");\n" +
- " } catch (Exception eFirst) {\n" +
- " e } catch (Exception eSecond) {\n" +
- " e }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable name into catch block>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MB {\n" +
- " public MB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception eFirst;\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMB_1FHSLMQ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLMQ\n" +
- " */\n" +
- "public class MB {\n" +
- " void foo() {\n" +
- " try {\n" +
- " System.out.println(\"\");\n" +
- " } catch (Exeption eFirst) {\n" +
- " e } catch (Exception eSecond) {\n" +
- " e }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable name into catch block>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MB {\n" +
- " public MB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " Exception eSecond;\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testMC_1FJ8D9Z() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ8D9Z\n" +
- " */\n" +
- "public class MC {\n" +
- " p2.X someField;\n" +
- " public void foo() {\n" +
- " new p2.X(\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object creation argument>";
- String completeBehind = "new p2.X(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new p2.X()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class MC {\n" +
- " p2.X someField;\n" +
- " public MC() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " <CompleteOnAllocationExpression:new p2.X()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testN() {
- String str =
- "package p; \n" +
- "public class N extends p.M {\n" +
- " void foo() {\n" +
- " class MLocal\n" +
- " extends Schmurz {\n" +
- " void foo() {\n" +
- " }\n" +
- " int field1;\n" +
- " class MLocalMember\n" +
- " extends myInnerC {\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " new M }\n" +
- " }\n" +
- " class MLocalMember2 {\n" +
- " void fooMyInnerC() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object creation type>";
- String completeBehind = "new M";
- String expectedCompletionNodeToString = "<CompleteOnType:M>";
- String completionIdentifier = "M";
- String expectedReplacedSource = "M";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class N extends p.M {\n" +
- " public N() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class MLocal extends Schmurz {\n" +
- " class MLocalMember extends myInnerC {\n" +
- " MLocalMember() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " void bar() {\n" +
- " new <CompleteOnType:M>();\n" +
- " }\n" +
- " }\n" +
- " class MLocalMember2 {\n" +
- " MLocalMember2() {\n" +
- " }\n" +
- " void fooMyInnerC() {\n" +
- " }\n" +
- " }\n" +
- " int field1;\n" +
- " MLocal() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNA_1() {
- String str =
- "package p; \n" +
- "class NException2\n" +
- " extends NoClassDefFoundError {\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public DA foo() {\n" +
- " }\n" +
- " public int foufou;\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- "}\n" +
- "public class NA\n" +
- " extends NException2\n" +
- " implements N {\n" +
- " DA fieldB;\n" +
- " class freak {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " local.fieldC.foo();\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- String testName = "<complete on local variable name>";
- String completeBehind = "l";
- String expectedCompletionNodeToString = "<CompleteOnName:l>";
- String completionIdentifier = "l";
- String expectedReplacedSource = "local";
- int cursorLocation = str.indexOf("local.") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class NException2 extends NoClassDefFoundError {\n" +
- " NException2() {\n" +
- " }\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public int foufou;\n" +
- " DAB() {\n" +
- " }\n" +
- " public DA foo() {\n" +
- " }\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- " DANA() {\n" +
- " }\n" +
- "}\n" +
- "public class NA extends NException2 implements N {\n" +
- " class freak {\n" +
- " freak() {\n" +
- " }\n" +
- " }\n" +
- " DA fieldB;\n" +
- " public NA() {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " <CompleteOnName:l>;\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNA_2() {
- String str =
- "package p; \n" +
- "class NException2\n" +
- " extends NoClassDefFoundError {\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public DA foo() {\n" +
- " }\n" +
- " public int foufou;\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- "}\n" +
- "public class NA\n" +
- " extends NException2\n" +
- " implements N {\n" +
- " DA fieldB;\n" +
- " class freak {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " local.fieldC.foo();\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable>";
- String completeBehind = "local.f";
- String expectedCompletionNodeToString = "<CompleteOnName:local.f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "local.fieldC";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class NException2 extends NoClassDefFoundError {\n" +
- " NException2() {\n" +
- " }\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public int foufou;\n" +
- " DAB() {\n" +
- " }\n" +
- " public DA foo() {\n" +
- " }\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- " DANA() {\n" +
- " }\n" +
- "}\n" +
- "public class NA extends NException2 implements N {\n" +
- " class freak {\n" +
- " freak() {\n" +
- " }\n" +
- " }\n" +
- " DA fieldB;\n" +
- " public NA() {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " <CompleteOnName:local.f>;\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNA_3() {
- String str =
- "package p; \n" +
- "class NException2\n" +
- " extends NoClassDefFoundError {\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public DA foo() {\n" +
- " }\n" +
- " public int foufou;\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- "}\n" +
- "public class NA\n" +
- " extends NException2\n" +
- " implements N {\n" +
- " DA fieldB;\n" +
- " class freak {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " local.fieldC.foo();\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable>";
- String completeBehind = "local.fieldC.";
- String expectedCompletionNodeToString = "<CompleteOnName:local.fieldC.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "local.fieldC.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class NException2 extends NoClassDefFoundError {\n" +
- " NException2() {\n" +
- " }\n" +
- "}\n" +
- "interface NInterface {\n" +
- " void foo();\n" +
- "}\n" +
- "class DAB {\n" +
- " public int foufou;\n" +
- " DAB() {\n" +
- " }\n" +
- " public DA foo() {\n" +
- " }\n" +
- "}\n" +
- "class DANA {\n" +
- " public int f;\n" +
- " N fieldC;\n" +
- " DANA() {\n" +
- " }\n" +
- "}\n" +
- "public class NA extends NException2 implements N {\n" +
- " class freak {\n" +
- " freak() {\n" +
- " }\n" +
- " }\n" +
- " DA fieldB;\n" +
- " public NA() {\n" +
- " }\n" +
- " void dede() {\n" +
- " DA local;\n" +
- " <CompleteOnName:local.fieldC.>;\n" +
- " }\n" +
- "}\n" +
- "interface NCool {\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNB() {
- String str =
- "package p; \n" +
- "public class NB {\n" +
- " void foo() {\n" +
- " int iOutside;\n" +
- " if (i != 0) {\n" +
- " for (int i = 10; --i >= 0;)\n" +
- " unit[i].parseMethod(\n" +
- " parser, \n" +
- " unit); \n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on variable name into for statement>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnName:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf("i >=") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class NB {\n" +
- " public NB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int iOutside;\n" +
- " {\n" +
- " int i;\n" +
- " -- <CompleteOnName:i>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testNC_1FJ8D9Z() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ8D9Z\n" +
- " */\n" +
- "public class NC {\n" +
- " String s = new String(\n";
-
- String testName = "<complete on field intializer into corrupted class declaration>";
- String completeBehind = "new String(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new String()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class NC {\n" +
- " String s = <CompleteOnAllocationExpression:new String()>;\n" +
- " public NC() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testO_1FG1YU0() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YU0\n" +
- " */\n" +
- "public class O\n" +
- " extends java.util.Vector {\n" +
- " void bar(boolean bbbb) {\n" +
- " this.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit this>";
- String completeBehind = "this.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "this.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class O extends java.util.Vector {\n" +
- " public O() {\n" +
- " }\n" +
- " void bar(boolean bbbb) {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOA_1() {
- String str =
- "package p; \n" +
- "public class OA {\n" +
- " void proc() {\n" +
- " int[] a = new int[10];\n" +
- " Object b = a;\n" +
- " Class c = a.getClass();\n" +
- " String s = a.toString();\n" +
- " boolean l = a.equals(b);\n" +
- " int h = a.hashCode();\n" +
- " try {\n" +
- " a.wait();\n" +
- " a.wait(3);\n" +
- " a.wait(4, 5);\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " a.notify();\n" +
- " a.notifyAll();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "a.n";
- String expectedCompletionNodeToString = "<CompleteOnName:a.n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "a.notify";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OA {\n" +
- " public OA() {\n" +
- " }\n" +
- " void proc() {\n" +
- " int[] a;\n" +
- " Object b;\n" +
- " Class c;\n" +
- " String s;\n" +
- " boolean l;\n" +
- " int h;\n" +
- " <CompleteOnName:a.n>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOA_2() {
- String str =
- "package p; \n" +
- "public class OA {\n" +
- " void proc() {\n" +
- " int[] a = new int[10];\n" +
- " Object b = a;\n" +
- " Class c = a.getClass();\n" +
- " String s = a.toString();\n" +
- " boolean l = a.equals(b);\n" +
- " int h = a.hashCode();\n" +
- " try {\n" +
- " a.wait();\n" +
- " a.wait(3);\n" +
- " a.wait(4, 5);\n" +
- " } catch (Exception e) {\n" +
- " }\n" +
- " a.notify();\n" +
- " a.notifyAll();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "a.w";
- String expectedCompletionNodeToString = "<CompleteOnName:a.w>";
- String completionIdentifier = "w";
- String expectedReplacedSource = "a.wait";
- int cursorLocation = str.indexOf("a.wait(4, 5)") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OA {\n" +
- " public OA() {\n" +
- " }\n" +
- " void proc() {\n" +
- " int[] a;\n" +
- " Object b;\n" +
- " Class c;\n" +
- " String s;\n" +
- " boolean l;\n" +
- " int h;\n" +
- " {\n" +
- " <CompleteOnName:a.w>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOB_1() {
- String str =
- "package p; \n" +
- "public class OB {\n" +
- " void foo() {\n" +
- " label : while (true) {\n" +
- " System.out.println(\"\");\n" +
- " break label;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on keyword>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "break";
- int cursorLocation = str.indexOf("break") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OB {\n" +
- " public OB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:b>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOB_2() {
- String str =
- "package p; \n" +
- "public class OB {\n" +
- " void foo() {\n" +
- " label : while (true) {\n" +
- " System.out.println(\"\");\n" +
- " break label;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on label name>";
- String completeBehind = "l";
- String expectedCompletionNodeToString = "<CompleteOnName:l>";
- String completionIdentifier = "l";
- String expectedReplacedSource = "label";
- int cursorLocation = str.indexOf("label") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class OB {\n" +
- " public OB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:l>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testOC_1FM7J7F() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FM7J7F\n" +
- " */\n" +
- "class OC {\n" +
- " String s = new String(\n" +
- "}\n";
-
- String testName = "<complete on field initializer>";
- String completeBehind = "new String(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new String()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class OC {\n" +
- " String s = <CompleteOnAllocationExpression:new String()>;\n" +
- " OC() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testP_1FG1YU0() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YU0\n" +
- " */\n" +
- "public class P {\n" +
- " {\n" +
- " void bar() {\n" +
- " f }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class P {\n" +
- " {\n" +
- " }\n" +
- " public P() {\n" +
- " }\n" +
- " void bar() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName); }
-public void testPA_1() {
- String str =
- "package p; \n" +
- "class PAHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " static int i = 1;\n" +
- " int neuneu1() {\n" +
- " return 0;\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class PA\n" +
- " extends PAHelper {\n" +
- " void foo() {\n" +
- " B[] b = \n" +
- " new java.lang.Number[]; \n" +
- " java.lang.Short s;\n" +
- " // b[1].;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "b[1].";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testPA_2() {
- String str =
- "package p; \n" +
- "class PAHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " static int i = 1;\n" +
- " int neuneu1() {\n" +
- " return 0;\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class PA\n" +
- " extends PAHelper {\n" +
- " void foo() {\n" +
- " B[] b = \n" +
- " new java.lang.Number[]; \n" +
- " java.lang.Short s;\n" +
- " // b[1].;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on new keyword>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "new";
- int cursorLocation = str.indexOf("new ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class PAHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static int i;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " PAHelper() {\n" +
- " }\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " int neuneu1() {\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class PA extends PAHelper {\n" +
- " public PA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " B[] b = <CompleteOnName:n>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testPB() {
- String str =
- "package p; \n" +
- "public class PB {\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " void foo() {\n" +
- " }\n" +
- " class LocalMember1 {\n" +
- " void foo() {\n" +
- " class LocalMemberLocal {\n" +
- " void foo() {\n" +
- " f\n"+
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class LocalMember2 {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into nested local type>";
- String completeBehind = "f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf("f\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class PB {\n" +
- " public PB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class Local {\n" +
- " class LocalMember1 {\n" +
- " LocalMember1() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class LocalMemberLocal {\n" +
- " LocalMemberLocal() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:f>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " class LocalMember2 {\n" +
- " LocalMember2() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " Local() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testPC_1FSU4EF() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSU4EF\n" +
- " */\n" +
- "import java.util.Vector;\n" +
- "public class PC {\n" +
- " void foo() {\n" +
- " class Inner {\n" +
- " Vector v = new Vector();\n" +
- " void foo() {\n" +
- " Vector v = new Vector();\n" +
- " v.addElement();\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into local type>";
- String completeBehind = "v.a";
- String expectedCompletionNodeToString = "<CompleteOnName:v.a>";
- String completionIdentifier = "a";
- String expectedReplacedSource = "v.addElement";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.util.Vector;\n" +
- "public class PC {\n" +
- " public PC() {\n" +
- " }\n" +
- " void foo() {\n" +
- " class Inner {\n" +
- " Vector v;\n" +
- " Inner() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Vector v;\n" +
- " <CompleteOnName:v.a>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQ_1FG1YU0() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FG1YU0\n" +
- " */\n" +
- "public class Q {\n" +
- " void bar(boolean bbbb) {\n" +
- " this.}\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "this.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "this.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class Q {\n" +
- " public Q() {\n" +
- " }\n" +
- " void bar(boolean bbbb) {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_1() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "new QAHelper().new Y().m";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QAHelper().new Y().m>";
- String completionIdentifier = "m";
- String expectedReplacedSource = "main";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " <CompleteOnMemberAccess:new QAHelper().new Y().m>;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_2() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new QAHelper().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QAHelper().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " <CompleteOnMemberAccess:new QAHelper().>;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_3() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new QAHelper().new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QAHelper().new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " <CompleteOnMemberAccess:new QAHelper().new Y().>;\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQA_4() {
- String str =
- "package p; \n" +
- "class QAHelper {\n" +
- " int i = 10;\n" +
- " void f() {\n" +
- " Chk.chkIntVal(\n" +
- " \"err_0\", \n" +
- " \"i\", \n" +
- " this.i, \n" +
- " i); \n" +
- " }\n" +
- " static class Y\n" +
- " extends QAHelper {\n" +
- " public void f() {\n" +
- " super.f();\n" +
- " int j = super.i;\n" +
- " }\n" +
- " public static void main(String a[]) {\n" +
- " Y oy = new Y();\n" +
- " oy.f();\n" +
- " }\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String s[] = \n" +
- " {\"Dolby\", \"Thx\",}; \n" +
- " void check() {\n" +
- " new QAHelper().new Y().main(\n" +
- " s); \n" +
- " }\n" +
- " static public void main(String args[]) {\n" +
- " new QA().check();\n" +
- " Chk.endTest(\"ciner111\");\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new QA().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new QA().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class QAHelper {\n" +
- " static class Y extends QAHelper {\n" +
- " Y() {\n" +
- " }\n" +
- " public void f() {\n" +
- " }\n" +
- " public static void main(String[] a) {\n" +
- " }\n" +
- " }\n" +
- " int i;\n" +
- " QAHelper() {\n" +
- " }\n" +
- " void f() {\n" +
- " }\n" +
- "}\n" +
- "public class QA {\n" +
- " static String[] s;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public QA() {\n" +
- " }\n" +
- " void check() {\n" +
- " }\n" +
- " public static void main(String[] args) {\n" +
- " <CompleteOnMemberAccess:new QA().>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testQB_1FIK820() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FIK820\n" +
- " */\n" +
- "public class QB {\n" +
- " void foo() {\n" +
- " {\n" +
- " }\n" +
- " .}\n" +
- "}\n";
-
- String testName = "<complete on block (no answers wanted)>";
- String completeBehind = ".";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(".}") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class QB {\n" +
- " public QB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testR_1FGD31E() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGD31E\n" +
- " */\n" +
- "public class R {\n" +
- " void moo() {\n" +
- " b }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "b";
- int cursorLocation = str.indexOf("b }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class R {\n" +
- " public R() {\n" +
- " }\n" +
- " void moo() {\n" +
- " <CompleteOnName:b>;\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRA_1() {
- String str =
- "package p; \n" +
- "public class RA extends A {\n" +
- " private int f = 5;\n" +
- " int i(int k) {\n" +
- " }\n" +
- " class B extends I {\n" +
- " void foo();\n" +
- " class C extends Z {\n" +
- " }\n" +
- " final int fo;\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- " static {\n" +
- " this.ff = 5;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on incorrect this call>";
- String completeBehind = "t";
- String expectedCompletionNodeToString = "<CompleteOnName:t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "this";
- int cursorLocation = str.indexOf("this.ff") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RA extends A {\n" +
- " class B extends I {\n" +
- " class C extends Z {\n" +
- " C() {\n" +
- " }\n" +
- " }\n" +
- " final int fo;\n" +
- " B() {\n" +
- " }\n" +
- " void foo();\n" +
- " }\n" +
- " private int f;\n" +
- " static {\n" +
- " <CompleteOnName:t>;\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public RA() {\n" +
- " }\n" +
- " int i(int k) {\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRA_2() {
- String str =
- "package p; \n" +
- "public class RA extends A {\n" +
- " private int f = 5;\n" +
- " int i(int k) {\n" +
- " }\n" +
- " class B extends I {\n" +
- " void foo();\n" +
- " class C extends Z {\n" +
- " }\n" +
- " final int fo;\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- " static {\n" +
- " this.ff = 5;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on t>";
- String completeBehind = "t";
- String expectedCompletionNodeToString = "<CompleteOnName:t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "this";
- int cursorLocation = str.indexOf("this") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RA extends A {\n" +
- " class B extends I {\n" +
- " class C extends Z {\n" +
- " C() {\n" +
- " }\n" +
- " }\n" +
- " final int fo;\n" +
- " B() {\n" +
- " }\n" +
- " void foo();\n" +
- " }\n" +
- " private int f;\n" +
- " static {\n" +
- " <CompleteOnName:t>;\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public RA() {\n" +
- " }\n" +
- " int i(int k) {\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRA_3() {
- String str =
- "package p; \n" +
- "public class RA extends A {\n" +
- " private int f = 5;\n" +
- " int i(int k) {\n" +
- " }\n" +
- " class B extends I {\n" +
- " void foo();\n" +
- " class C extends Z {\n" +
- " }\n" +
- " final int fo;\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, Exc {\n" +
- " }\n" +
- " static {\n" +
- " this.ff = 5;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on exception type>";
- String completeBehind = "Exc";
- String expectedCompletionNodeToString = "<CompleteOnException:Exc>";
- String completionIdentifier = "Exc";
- String expectedReplacedSource = "Exc";
- int cursorLocation = str.indexOf("Exc {") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RA extends A {\n" +
- " class B extends I {\n" +
- " class C extends Z {\n" +
- " C() {\n" +
- " }\n" +
- " }\n" +
- " final int fo;\n" +
- " B() {\n" +
- " }\n" +
- " void foo();\n" +
- " }\n" +
- " private int f;\n" +
- " static {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public RA() {\n" +
- " }\n" +
- " int i(int k) {\n" +
- " }\n" +
- " final void foo(k j) {\n" +
- " }\n" +
- " o o() throws Exc, <CompleteOnException:Exc> {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testRB_1FI74S3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FI74S3\n" +
- " */\n" +
- "public class RB {\n" +
- " int[] table;\n" +
- " void foo() {\n" +
- " int x = table.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of arry>";
- String completeBehind = "table.";
- String expectedCompletionNodeToString = "<CompleteOnName:table.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "table.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class RB {\n" +
- " int[] table;\n" +
- " public RB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = <CompleteOnName:table.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testS_1FGF64P_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class S {\n" +
- " {\n" +
- " new Y()..}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on incorrect call>";
- String completeBehind = "new Y()..";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class S {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " }\n" +
- " public S() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testS_1FGF64P_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class S {\n" +
- " {\n" +
- " new Y()..}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class S {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " <CompleteOnMemberAccess:new Y().>;\n" +
- " }\n" +
- " public S() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testS_1FGF64P_3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class S {\n" +
- " {\n" +
- " new Y()..}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on incorrect call>";
- String completeBehind = "new Y()..";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class S {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " {\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- " }\n" +
- " public S() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testSA() {
- String str =
- "package p; \n" +
- "public class SA {\n" +
- " public sy void foo() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method modifier>";
- String completeBehind = "sy";
- String expectedCompletionNodeToString = "<CompleteOnType:sy>";
- String completionIdentifier = "sy";
- String expectedReplacedSource = "sy";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class SA {\n" +
- " <CompleteOnType:sy>;\n" +
- " public SA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testSB_1FILFDG() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FILFDG\n" +
- " */\n" +
- "public class SB {\n" +
- " public void foo() {\n" +
- " String s = \"hello\n" +
- " int}\n" +
- "}\n";
-
- String testName = "<complete on field declaration type>";
- String completeBehind = "int";
- String expectedCompletionNodeToString = "<CompleteOnName:int>";
- String completionIdentifier = "int";
- String expectedReplacedSource = "int";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class SB {\n" +
- " public SB() {\n" +
- " }\n" +
- " public void foo() {\n" +
- " String s;\n" +
- " <CompleteOnName:int>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testT_1FGF64P() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGF64P\n" +
- " */\n" +
- "public class T {\n" +
- " {\n" +
- " new Y().}\n" +
- " class Y {\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on object creation>";
- String completeBehind = "new Y().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new Y().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class T {\n" +
- " class Y {\n" +
- " Y() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- " }\n" +
- " {\n" +
- " <CompleteOnMemberAccess:new Y().>;\n" +
- " }\n" +
- " public T() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTA_1FHISJJ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class TA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on array intializer value>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "null";
- int cursorLocation = str.indexOf("null, ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TA {\n" +
- " public TA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items = {<CompleteOnName:n>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTA_1FHISJJ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class TA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array intializer>";
- String completeBehind =
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .";
- String expectedCompletionNodeToString = "<CompleteOnName:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TA {\n" +
- " public TA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items;\n" +
- " <CompleteOnName:>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTA_1FHISJJ_3() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class TA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "items.";
- String expectedCompletionNodeToString = "<CompleteOnName:items.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "items.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TA {\n" +
- " public TA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items;\n" +
- " <CompleteOnName:items.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testTB_1FHSLMQ() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHSLMQ\n" +
- " */\n" +
- "public class TB {\n" +
- " void foo() {\n" +
- " if (true)\n" +
- " System.out.println(\"\");\n" +
- " e }\n" +
- "}\n";
-
- String testName = "<complete on else keyword>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class TB {\n" +
- " public TB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testU_1FGGUME() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGUME\n" +
- " */\n" +
- "public class U {\n" +
- " public static final int Source = \n" +
- " 5; \n" +
- "}\n";
-
- String testName = "<complete on digit>";
- String completeBehind = "5";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_NUMBER);
- }
-}
-public void testUA_1FHISJJ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class UA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " new String[] {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on array initializer>";
- String completeBehind =
- "new String[] {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String[]{\"Mark unublishable\", null, \"Properties...\"}.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class UA {\n" +
- " public UA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items = <CompleteOnMemberAccess:new String[]{\"Mark unublishable\", null, \"Properties...\"}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testUA_1FHISJJ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class UA {\n" +
- " void foo() {\n" +
- " Object[] items = \n" +
- " new String[] {\n" +
- " \"Mark unublishable\", \n" +
- " null, \n" +
- " \"Properties...\"}\n" +
- " .;\n" +
- " items.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of array>";
- String completeBehind = "items.";
- String expectedCompletionNodeToString = "<CompleteOnName:items.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "items.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class UA {\n" +
- " public UA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] items;\n" +
- " <CompleteOnName:items.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testUB_1FSBZ02() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FSBZ02\n" +
- " */\n" +
- "class UB {\n" +
- " void bar() {\n" +
- " }\n" +
- " class UBMember {\n" +
- " void bar2() {\n" +
- " }\n" +
- " void foo() {\n" +
- " b\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on keyword>";
- String completeBehind = "b";
- String expectedCompletionNodeToString = "<CompleteOnName:b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "b";
- int cursorLocation = str.indexOf("b\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class UB {\n" +
- " class UBMember {\n" +
- " UBMember() {\n" +
- " }\n" +
- " void bar2() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnName:b>;\n" +
- " }\n" +
- " }\n" +
- " UB() {\n" +
- " }\n" +
- " void bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testV_1FGGUOO_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGUOO\n" +
- " */\n" +
- "public class V i java\n" +
- " .io\n" +
- " .Serializable {\n" +
- "}\n";
-
- String testName = "<complete on implements keyword>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "i";
- int cursorLocation = str.indexOf("i java") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class V extends <CompleteOnKeyword:i> {\n" +
- " {\n" +
- " }\n" +
- " public V() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testV_1FGGUOO_2() {
- String str =
- "package x.y.z; \n" +
- "/**\n" +
- " * 1FGGUOO\n" +
- " */\n" +
- "public class V implements java.io.Serializable {\n" +
- "}\n";
-
- String testName = "<complete on package>";
- String completeBehind = "y";
- String expectedCompletionNodeToString = "<CompleteOnPackage:x.y>";
- String completionIdentifier = "y";
- String expectedReplacedSource =
- "x.y.z";
- int cursorLocation = str.indexOf("y") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package <CompleteOnPackage:x.y>;\n" +
- "public class V implements java.io.Serializable {\n" +
- " public V() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVA_1FHISJJ_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class VA {\n" +
- " void foo() {\n" +
- " Object item = new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " .;\n" +
- " item.}\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration>";
- String completeBehind =
- "new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " .";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VA {\n" +
- " public VA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object item = <CompleteOnMemberAccess:new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVA_1FHISJJ_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FHISJJ\n" +
- " */\n" +
- "public class VA {\n" +
- " void foo() {\n" +
- " Object item = new String() {\n" +
- " public boolean equals() {\n" +
- " return false;\n" +
- " }\n" +
- " }\n" +
- " .;\n" +
- " item.}\n" +
- "}\n";
-
- String testName = "<complete on local variable>";
- String completeBehind = "item.";
- String expectedCompletionNodeToString = "<CompleteOnName:item.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "item.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VA {\n" +
- " public VA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object item;\n" +
- " <CompleteOnName:item.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVB_1() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on local variable name into anonymous declaration>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "v";
- int cursorLocation = str.indexOf("v }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111;\n" +
- " <CompleteOnName:v>;\n" +
- " }\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// TODO excluded test (completion on field access on anonymous inner class with syntax error)
-public void _testVB_2() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration>";
- String completeBehind =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- String expectedCompletionNodeToString =
- "<CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testVB_3() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on constructor>";
- String completeBehind = "new java.io.File(";
- String expectedCompletionNodeToString = "<CompleteOnAllocationExpression:new java.io.File()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnAllocationExpression:new java.io.File()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// TODO excluded test (completion on field access on anonymous inner class with syntax error)
-public void _testVB_4() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration with dummy spaces>";
- String completeBehind =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .";
- String expectedCompletionNodeToString =
- "<CompleteOnName:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }\n" +
- " .";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// TODO excluded test (completion on field access on anonymous inner class with syntax error)
-public void _testVB_5() {
- String str =
- "package p; \n" +
- "public class VB {\n" +
- " void foo() {\n" +
- " new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.;\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration with trailing semi-colon>";
- String completeBehind =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- String expectedCompletionNodeToString =
- "<CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>";
- String completionIdentifier = "";
- String expectedReplacedSource =
- "new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " Vector v11111 = new Vector();\n" +
- " v }\n" +
- " }.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class VB {\n" +
- " public VB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new java.io.File(\"error\") {\n" +
- " protected void runTest() {\n" +
- " }\n" +
- "}.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testW_1FGGUS4() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGGUS4\n" +
- " */\n" +
- "public class W {\n" +
- " public static final int LA = \n" +
- " 1; \n" +
- " public static final int LAB = \n" +
- " 2; \n" +
- " public static final int LABO = \n" +
- " 4; \n" +
- " public int produceDebugAttributes = \n" +
- " LABO; \n" +
- "}\n";
-
- String testName = "<complete on field initializer>";
- String completeBehind = "L";
- String expectedCompletionNodeToString = "<CompleteOnName:L>";
- String completionIdentifier = "L";
- String expectedReplacedSource = "LABO";
- int cursorLocation = str.indexOf("LABO;") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class W {\n" +
- " public static final int LA;\n" +
- " public static final int LAB;\n" +
- " public static final int LABO;\n" +
- " public int produceDebugAttributes = <CompleteOnName:L>;\n" +
- " public W() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testWA_1() {
- String str =
- "package p; \n" +
- "public class WA {\n" +
- " void foo() {\n" +
- " int value = 10;\n" +
- " v int[] tab = new int[value];\n" +
- " }\n";
-
- String testName = "<complete on array size value>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "value";
- int cursorLocation = str.indexOf("value];") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class WA {\n" +
- " public WA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int value;\n" +
- " int[] tab = new int[<CompleteOnName:v>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testWA_2() {
- String str =
- "package p; \n" +
- "public class WA {\n" +
- " void foo() {\n" +
- " int value = 10;\n" +
- " v int[] tab = new int[value];\n" +
- " }\n";
-
- String testName = "<complete on corrupter local variable declaration>";
- String completeBehind = "v";
- String expectedCompletionNodeToString = "<CompleteOnName:v>";
- String completionIdentifier = "v";
- String expectedReplacedSource = "v";
- int cursorLocation = str.indexOf("v int[]") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class WA {\n" +
- " public WA() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int value;\n" +
- " <CompleteOnName:v>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testWB_1FI313C() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FI313C\n" +
- " */\n" +
- "class WBHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " static int i = d;\n" +
- " int neuneu1() {\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class WB\n" +
- " extends WBHelper {\n" +
- " void foo() {\n" +
- " BIJOUR[] b = \n" +
- " new java.lang.Number[]; \n" +
- " java.lang.Short s;\n" +
- " b[1].}\n" +
- " B() {\n" +
- " }\n" +
- " B(int) {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of array element>";
- String completeBehind = "b[1].";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:b[1].>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "class WBHelper {\n" +
- " public int fieldPublic;\n" +
- " protected int fieldProtected;\n" +
- " private int fieldPrivate;\n" +
- " int fieldDefault;\n" +
- " static int i;\n" +
- " WBHelper() {\n" +
- " }\n" +
- " <clinit>() {\n" +
- " }\n" +
- " static void staticFoo() {\n" +
- " }\n" +
- " int neuneu1() {\n" +
- " }\n" +
- " void neuneu2() {\n" +
- " }\n" +
- "}\n" +
- "public class WB extends WBHelper {\n" +
- " public WB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " BIJOUR[] b;\n" +
- " java.lang.Short s;\n" +
- " <CompleteOnMemberAccess:b[1].>;\n" +
- " }\n" +
- " B() {\n" +
- " }\n" +
- " B() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_1() {
- String str =
- "package p; \n" +
- "import p2.Y; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new Y[] {\n" +
- " new Y(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on argument of anonymous type declaration>";
- String completeBehind = "t";
- String expectedCompletionNodeToString = "<CompleteOnName:t>";
- String completionIdentifier = "t";
- String expectedReplacedSource = "this";
- int cursorLocation = str.indexOf("this, ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " new Y(\"debug.vars\", <CompleteOnName:t>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_2() {
- String str =
- "package p; \n" +
- "import p2.YZA; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new YZA[] {\n" +
- " new YZA(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration into a return statement>";
- String completeBehind = "Y";
- String expectedCompletionNodeToString = "<CompleteOnType:Y>";
- String completionIdentifier = "Y";
- String expectedReplacedSource = "YZA";
- int cursorLocation = str.indexOf("YZA[]") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.YZA;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " return new <CompleteOnType:Y>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_3() {
- String str =
- "package p; \n" +
- "import p2.YZA; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new YZA[] {\n" +
- " new YZA(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new YZA(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on anonymous type declaration nested into an array initializer>";
- String completeBehind = "Y";
- String expectedCompletionNodeToString = "<CompleteOnType:Y>";
- String completionIdentifier = "Y";
- String expectedReplacedSource = "YZA";
- int cursorLocation = str.indexOf("YZA(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.YZA;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " new YZA[]{new <CompleteOnType:Y>()};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGGV8C_4() {
- String str =
- "package p; \n" +
- "import p2.Y; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new Y[] {\n" +
- " new Y(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into array intializer>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "new";
- int cursorLocation = str.indexOf("new Y(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " new Y[]{<CompleteOnName:n>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testX_1FGPE8E() {
- String str =
- "package p; \n" +
- "import p2.Y; \n" +
- "/**\n" +
- " * 1FGGV8C and 1FGPE8E\n" +
- " */\n" +
- "public class X {\n" +
- " public static final float Vars; \n" +
- " public static final float Lines; \n" +
- " public static final float Source; \n" +
- " public static final float UnreachableCode; \n" +
- " public static final float produceDebugAttributes; \n" +
- " void foo() {\n" +
- " int locale, \n" +
- " errorThreshold, \n" +
- " preserveAllLocalVariables; \n" +
- " return new Y[] {\n" +
- " new Y(\n" +
- " \"debug.vars\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Vars)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.lines\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Lines)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.source\", \n" +
- " this, \n" +
- " locale, \n" +
- " (produceDebugAttributes\n" +
- " & Source)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"debug.preserveAllLocals\", \n" +
- " this, \n" +
- " locale, \n" +
- " preserveAllLocalVariables\n" +
- " ? 0\n" +
- " : 1), \n" +
- " new Y(\n" +
- " \"optionalError.unReachableCode\", \n" +
- " this, \n" +
- " locale, \n" +
- " (errorThreshold\n" +
- " & UnreachableCode)\n" +
- " != 0\n" +
- " ? 0\n" +
- " : 1)\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field into return statement>";
- String completeBehind = "n";
- String expectedCompletionNodeToString = "<CompleteOnName:n>";
- String completionIdentifier = "n";
- String expectedReplacedSource = "new";
- int cursorLocation = str.indexOf("new Y[]") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import p2.Y;\n" +
- "public class X {\n" +
- " public static final float Vars;\n" +
- " public static final float Lines;\n" +
- " public static final float Source;\n" +
- " public static final float UnreachableCode;\n" +
- " public static final float produceDebugAttributes;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int locale;\n" +
- " int errorThreshold;\n" +
- " int preserveAllLocalVariables;\n" +
- " return <CompleteOnName:n>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-// Disabled since javadoc completion has been implemented
-public void _testXA_1FGGUQF_1FHSL8H_1() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */\n" +
- " foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "int.";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int.\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXA_1FGGUQF_1FHSL8H_2() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */\n" +
- " foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int\n") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXA_1FGGUQF_1FHSL8H_3() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */ foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int */") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXA_1FGGUQF_1FHSL8H_4() {
- String str =
- "// int\n" +
- "package p; \n" +
- "/**\n" +
- " * 1FGGUQF and 1FHSL8H\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "/*\n" +
- " * int\n" +
- " */\n" +
- "// int\n" +
- "/**\n" +
- "int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- "/**\n" +
- " * int\n" +
- " */\n" +
- "public class XA {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " void /* int */ foo() {\n" +
- " // int\n" +
- " /* int */\n" +
- " /** int */\n" +
- " }\n" +
- " /**\n" +
- " int.\n" +
- " * Internal API used to resolve a compilation unit minimally for code assist engine\n" +
- " */\n" +
- " int field /* int */\n" +
- " ;\n" +
- " /*\n" +
- " int\n" +
- " */\n" +
- " static {\n" +
- " // int\n" +
- " }\n" +
- "}\n" +
- "// int\n" +
- "/* int */\n" +
- "/** int */\n";
-
- String testName = "<complete on comment>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = NONE;
- String completionIdentifier = "";
- String expectedReplacedSource = NONE;
- int cursorLocation = str.indexOf("int */ foo()") + completeBehind.length() - 1;
- String expectedUnitDisplayString = null;
-
- try {
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
- assertTrue("failed to detect invalid cursor location", false);
- } catch(InvalidCursorLocation e){
- assertEquals("invalid cursor location: ", e.irritant, InvalidCursorLocation.NO_COMPLETION_INSIDE_COMMENT);
- }
-}
-public void testXB_1FIYM5I_1() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit this access>";
- String completeBehind = "this.s";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.s>";
- String completionIdentifier = "s";
- String expectedReplacedSource = "this.separator";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.s>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testXB_1FIYM5I_2() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicitly accessed field>";
- String completeBehind = "this.separator.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.separator.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.separator.>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testXB_1FIYM5I_3() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicit this access>";
- String completeBehind = "this.b";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.b>";
- String completionIdentifier = "b";
- String expectedReplacedSource = "this.bar";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.b>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testXB_1FIYM5I_4() {
- String str =
- "package p; \n" +
- "/*\n" +
- " * 1FIYM5I\n" +
- " */\n" +
- "public class XB\n" +
- " extends java.io.File {\n" +
- " void foo() {\n" +
- " XB xb = new XB();\n" +
- " this.separator.;\n" +
- " this.bar().;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field of explicitly accessed method>";
- String completeBehind = "this.bar().";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.bar().>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class XB extends java.io.File {\n" +
- " public XB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " XB xb;\n" +
- " <CompleteOnMemberAccess:this.bar().>;\n" +
- " }\n" +
- " String bar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testY_1FGPESI() {
- String str =
- "package p; \n" +
- "import p2.; \n" +
- "/**\n" +
- " * 1FGPESI\n" +
- " */\n" +
- "public class Y {\n" +
- "}\n";
-
- String testName = "<complete on imports>";
- String completeBehind = "p2.";
- String expectedCompletionNodeToString = "<CompleteOnImport:p2.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "p2.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:p2.>;\n" +
- "public class Y {\n" +
- " public Y() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testYA_1FGRIUH() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGRIUH\n" +
- " */\n" +
- "public class YA\n" +
- " extends YASecondTopLevel {\n" +
- " void eFoo() {\n" +
- " }\n" +
- " class YAMember {\n" +
- " void eFoo() {\n" +
- " }\n" +
- " void eBar() {\n" +
- " e }\n" +
- " }\n" +
- "}\n" +
- "class YASecondTopLevel {\n" +
- " public boolean equals(YA yaya) {\n" +
- " return true;\n" +
- " }\n" +
- " public eFoo() {\n" +
- " }\n" +
- " public void eFooBar() {\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete on method/field>";
- String completeBehind = "e";
- String expectedCompletionNodeToString = "<CompleteOnName:e>";
- String completionIdentifier = "e";
- String expectedReplacedSource = "e";
- int cursorLocation = str.indexOf("e }") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class YA extends YASecondTopLevel {\n" +
- " class YAMember {\n" +
- " YAMember() {\n" +
- " }\n" +
- " void eFoo() {\n" +
- " }\n" +
- " void eBar() {\n" +
- " <CompleteOnName:e>;\n" +
- " }\n" +
- " }\n" +
- " public YA() {\n" +
- " }\n" +
- " void eFoo() {\n" +
- " }\n" +
- "}\n" +
- "class YASecondTopLevel {\n" +
- " YASecondTopLevel() {\n" +
- " }\n" +
- " public boolean equals(YA yaya) {\n" +
- " }\n" +
- " public eFoo() {\n" +
- " }\n" +
- " public void eFooBar() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testYB_1FJ4D46_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ4D46\n" +
- " */\n" +
- "public class YB {\n" +
- " void foo() {\n" +
- " new String(\"asdf\".getBytes()).}\n" +
- "}\n";
-
- String testName = "<complete on method/field of object creation>";
- String completeBehind = "new String(\"asdf\".getBytes()).";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:new String(\"asdf\".getBytes()).>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class YB {\n" +
- " public YB() {\n" +
- " }\n" +
- " void foo() {\n" +
- " <CompleteOnMemberAccess:new String(\"asdf\".getBytes()).>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZ_1FGPF3D_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGPF3D\n" +
- " */\n" +
- "public class Z imp Pro.Sev, \n" +
- " Bla.Blo {\n" +
- "}\n";
-
- String testName = "<complete on implements keyword>";
- String completeBehind = "imp";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:imp>";
- String completionIdentifier = "imp";
- String expectedReplacedSource = "imp";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class Z extends <CompleteOnKeyword:imp> {\n" +
- " {\n" +
- " }\n" +
- " public Z() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZ_1FGPF3D_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FGPF3D\n" +
- " */\n" +
- "public class Z implements Pro.Sev, \n" +
- " Bla.Blo {\n" +
- "}\n";
-
- String testName = "<complete on implented interface>";
- String completeBehind = "P";
- String expectedCompletionNodeToString = "<CompleteOnInterface:P>";
- String completionIdentifier = "P";
- String expectedReplacedSource = "Pro";
- int cursorLocation = str.indexOf("Pro.Sev") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class Z implements <CompleteOnInterface:P>, Bla.Blo {\n" +
- " public Z() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZA_1() {
- String str =
- "package p; \n" +
- "import java.util.Vector;\n";
-
- String testName = "<complete on import keyword>";
- String completeBehind = "i";
- String expectedCompletionNodeToString = "<CompleteOnKeyword:i>";
- String completionIdentifier = "i";
- String expectedReplacedSource = "import";
- int cursorLocation = str.indexOf("import") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnKeyword:i>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZA_2() {
- String str =
- "package p; \n" +
- "import java.util.Vector;\n";
-
- String testName = "<complete on imported package>";
- String completeBehind = "jav";
- String expectedCompletionNodeToString = "<CompleteOnImport:jav>";
- String completionIdentifier = "jav";
- String expectedReplacedSource = "java.util.Vector";
- int cursorLocation = str.indexOf("java.util.Vector") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:jav>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZA_3() {
- String str =
- "package p; \n" +
- "import java.util.Vector;\n";
-
- String testName = "<complete on imported type>";
- String completeBehind = "java.util.V";
- String expectedCompletionNodeToString = "<CompleteOnImport:java.util.V>";
- String completionIdentifier = "V";
- String expectedReplacedSource = "java.util.Vector";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import <CompleteOnImport:java.util.V>;\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZB_1FJ4D46_1() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ4D46\n" +
- " */\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " File file = \n" +
- " new File(\"d:\\\\314\"); \n" +
- " CRC32 crc = new CRC32();\n" +
- " file.}\n" +
- "}\n";
-
- String testName = "<complete on method/field of local variable>";
- String completeBehind = "file.";
- String expectedCompletionNodeToString = "<CompleteOnName:file.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "file.";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public ZB() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " File file;\n" +
- " CRC32 crc;\n" +
- " <CompleteOnName:file.>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-public void testZB_1FJ4D46_2() {
- String str =
- "package p; \n" +
- "/**\n" +
- " * 1FJ4D46\n" +
- " */\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public static void main(\n" +
- " java.lang.String[] args) {\n" +
- " File file = \n" +
- " new File(\"d:\\\\314\"); \n" +
- " CRC32 crc = new CRC32();\n" +
- " file.}\n" +
- "}\n";
-
- String testName = "<complete on local variable type>";
- String completeBehind = "CRC";
- String expectedCompletionNodeToString = "<CompleteOnName:CRC>";
- String completionIdentifier = "CRC";
- String expectedReplacedSource = "CRC32";
- int cursorLocation = str.indexOf("CRC32 crc") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "import java.util.zip.CRC32;\n" +
- "import java.io.*;\n" +
- "public class ZB {\n" +
- " public ZB() {\n" +
- " }\n" +
- " public static void main(java.lang.String[] args) {\n" +
- " File file;\n" +
- " <CompleteOnName:CRC>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in initializer
- */
-public void test001(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int v1;\n" +
- " {\n" +
- " Obj\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete in initializer>";
- String completeBehind = "Obj";
- String expectedCompletionNodeToString = "<CompleteOnName:Obj>";
- String completionIdentifier = "Obj";
- String expectedReplacedSource = "Obj";
- int cursorLocation = str.indexOf("Obj") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " {\n" +
- " <CompleteOnName:Obj>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete after initializer
- */
-public void test002(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int v1;\n" +
- " {\n" +
- " int v2\n" +
- " }\n" +
- " Obj" +
- " }\n" +
- "}\n";
-
- String testName = "<complete after initializer>";
- String completeBehind = "Obj";
- String expectedCompletionNodeToString = "<CompleteOnName:Obj>";
- String completionIdentifier = "Obj";
- String expectedReplacedSource = "Obj";
- int cursorLocation = str.indexOf("Obj") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " <CompleteOnName:Obj>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in initializer
- */
-public void test003(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int v1;\n" +
- " {\n" +
- " this.\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete in initializer>";
- String completeBehind = "this.";
- String expectedCompletionNodeToString = "<CompleteOnMemberAccess:this.>";
- String completionIdentifier = "";
- String expectedReplacedSource = "this.";
- int cursorLocation = str.indexOf("this.") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int v1;\n" +
- " {\n" +
- " <CompleteOnMemberAccess:this.>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-/**
- * Complete in switch
- */
-public void test004(){
- String str =
- "public class X {\n" +
- " final static int ZZZ = 1;\n"+
- " void foo(){\n" +
- " switch(2)\n" +
- " case 0 + ZZZ :\n" +
- " case 1 + ZZZ :\n" +
- " bar(ZZZ)\n" +
- " }\n" +
- " void bar(int y) {}\n"+
- "}\n";
-
- String testName = "<complete in switch>";
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompleteOnName:ZZZ>";
- String completionIdentifier = "ZZZ";
- String expectedReplacedSource = "ZZZ";
- int cursorLocation = str.lastIndexOf("ZZZ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " static final int ZZZ;\n" +
- " <clinit>() {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(<CompleteOnName:ZZZ>);\n" +
- " }\n" +
- " void bar(int y) {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in method type.
- */
-public void test005(){
- String str =
- "public class X {\n" +
- " clon foo(){\n" +
- " }\n" +
- "}\n";
-
- String testName = "<complete in method type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " <CompleteOnType:clon>\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in method type.
- */
-public void test006(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " foo();\n" +
- "}\n";
-
- String testName = "<complete in method type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- " foo();\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in field type.
- */
-public void test007(){
- String str =
- "public class X {\n" +
- " clon x;\n" +
- "}\n";
-
- String testName = "<complete in field type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in field type.
- */
-public void test008(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " x;\n" +
- "}\n";
-
- String testName = "<complete in field type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in field type.
- */
-public void test009(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " x y;\n" +
- "}\n";
-
- String testName = "<complete in field tpye>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " x y;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * Complete in method type.
- */
-public void test010(){
- String str =
- "public class X {\n" +
- " clon\n" +
- " x y(){}\n" +
- "}\n";
-
- String testName = "<complete in method type>";
- String completeBehind = "clon";
- String expectedCompletionNodeToString = "<CompleteOnType:clon>;";
- String completionIdentifier = "clon";
- String expectedReplacedSource = "clon";
- int cursorLocation = str.lastIndexOf("clon") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " <CompleteOnType:clon>;\n" +
- " public X() {\n" +
- " }\n" +
- " x y() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=25233
- */
-public void test011(){
- String str =
- "public class X {\n" +
- " void foo() {\n" +
- " new Object[]{\n" +
- " bar(zzz)\n" +
- " };\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 25233>";
- String completeBehind = "zzz";
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- int cursorLocation = str.lastIndexOf("zzz") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=27370
- */
-public void test012(){
- String str =
- "public class X {\n" +
- " public X() {\n" +
- " super();\n" +
- " }\n" +
- " Object o = new ZZZ\n" +
- "}\n";
-
- String testName = "<bug 27370>";
- String completeBehind = "ZZZ";
- String expectedCompletionNodeToString = "<CompleteOnType:ZZZ>";
- String completionIdentifier = "ZZZ";
- String expectedReplacedSource = "ZZZ";
- int cursorLocation = str.lastIndexOf("ZZZ") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class X {\n" +
- " Object o = new <CompleteOnType:ZZZ>();\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=27735
- */
-public void test013(){
- String str =
- "public class Bar {\n" +
- " #\n" +
- " Bar foo1 = new Bar(){};\n" +
- " {int i;}\n" +
- " synchronized void foo3() {}\n" +
- " zzz\n" +
- "}\n";
-
- String testName = "<bug 27735>";
- String completeBehind = "zzz";
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- int cursorLocation = str.lastIndexOf("zzz") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " Bar foo1;\n" +
- " {\n" +
- " }\n" +
- " <CompleteOnType:zzz>;\n" +
- " public Bar() {\n" +
- " }\n" +
- " synchronized void foo3() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=27941
- */
-public void test014(){
- String str =
- "public class Bar {\n" +
- " void foo() {\n" +
- " String s = \"a\" + \"b\";\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 27941>";
- String completeBehind = "zzz";
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- int cursorLocation = str.lastIndexOf("zzz") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " public Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " String s;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=39502
- */
-public void test015(){
- String str =
- "public class Bar {\n" +
- " void foo() {\n" +
- " Object o = new Object[]{};\n" +
- " foo();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 39502>";
- String completeBehind = "foo(";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:foo()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "foo(";
- int cursorLocation = str.lastIndexOf("foo(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " public Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnMessageSend:foo()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-/**
- * http://dev.eclipse.org/bugs/show_bug.cgi?id=39502
- */
-public void test016(){
- String str =
- "public class Bar {\n" +
- " void foo() {\n" +
- " Object o = new Object[0];\n" +
- " foo();\n" +
- " }\n" +
- "}\n";
-
- String testName = "<bug 39502>";
- String completeBehind = "foo(";
- String expectedCompletionNodeToString = "<CompleteOnMessageSend:foo()>";
- String completionIdentifier = "";
- String expectedReplacedSource = "foo(";
- int cursorLocation = str.lastIndexOf("foo(") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " public Bar() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnMessageSend:foo()>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void test017(){
- String str =
- "public class Bar {\n" +
- " String s;\n" +
- " /**/\n" +
- "}\n";
-
- String testName = "";
- String completeBehind = "/**/";
- String expectedCompletionNodeToString = "<CompleteOnType:>";
- String completionIdentifier = "";
- String expectedReplacedSource = "";
- int cursorLocation = str.lastIndexOf("/**/") + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "public class Bar {\n" +
- " String s;\n" +
- " <CompleteOnType:>;\n" +
- " public Bar() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-public void testRECOVERY001() {
- String str =
- "var foo;\n" +
- "if (f) {\n";
-
- String testName = "<complete on name inside if>";
- String completeBehind = "(f";
- String expectedCompletionNodeToString = "<CompleteOnName:f>";
- String completionIdentifier = "f";
- String expectedReplacedSource = "f";
- int cursorLocation = str.indexOf(completeBehind) + completeBehind.length() - 1;
- String expectedUnitDisplayString =
- "var foo;\n" +
- "if (<CompleteOnName:f>)\n" +
- "\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- testName);
-}
-
-}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java b/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java
deleted file mode 100644
index 866e47b..0000000
--- a/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/CompletionParserTest2.java
+++ /dev/null
@@ -1,9671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.compiler.parser;
-
-import junit.framework.Test;
-
-public class CompletionParserTest2 extends AbstractCompletionTest {
-public CompletionParserTest2(String testName) {
- super(testName);
-}
-public static Test suite() {
- return buildAllCompliancesTestSuite(CompletionParserTest2.class);
-}
-public void test0001(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0002(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0003(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0004(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0005(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0006(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0007(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0008(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0009(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0010(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0011(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0012(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "Object o = new <CompleteOnType:zzz>();";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0013(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0014(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0015(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0016(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0017(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0018(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0019(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = bar(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0020(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0021(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0022(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = bar(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0023(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0024(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = bar(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "bar(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = bar(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0025(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0026(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0027(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0028(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new X(zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0029(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0030(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new X(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X(<CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X(<CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0031(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0032(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0033(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0034(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0035(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0036(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0037(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0038(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0039(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0040(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = {zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0041(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0042(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = {zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = {<CompleteOnName:zzz>};";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = {<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0043(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-
-public void test0044(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-
-public void test0045(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-
-public void test0046(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-
-public void test0047(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-
-public void test0048(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0049(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0050(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0051(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0052(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-public void test0053(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0054(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0055(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0056(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0057(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0058(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object[] o = zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0059(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0060(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object[] o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "Object[] o = <CompleteOnName:zzz>;";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object[] o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0061(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0062(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0063(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0064(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new X[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-public void test0065(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0066(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new X[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0067(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0068(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0069(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0070(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0071(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0072(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " Object o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0073(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0074(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0075(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0076(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " int o = new int[zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0077(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0078(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " int o = new int[zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[<CompleteOnName:zzz>]";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o = new int[<CompleteOnName:zzz>];\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0079(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " int o = new int[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0080(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " int o = new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0081(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o = new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0082(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " int o = new int[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0083(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0084(){
-
-
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " int o = new int[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new int[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new int[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0085(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " X o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0086(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " X o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0087(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X o = new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0088(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " X o = new X[]{zzz;\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0089(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0090(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " #\n" +
- " X o = new X[]{zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- String expectedParentNodeToString = "new X[]{<CompleteOnName:zzz>}";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " new X[]{<CompleteOnName:zzz>};\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " X o;\n" +
- " {\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0091(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0092(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0093(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0094(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " #\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "zzz";
- String expectedReplacedSource = "zzz";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " Object o;\n" +
- " <CompleteOnType:zzz>;\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-}
-
-
-public void test0095(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-
-public void test0096(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " #\n" +
- " Object o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " {\n" +
- " {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- " }\n" +
- " public X() {\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0097(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "o = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0098(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "o = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0099(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0100(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = new zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:zzz>";
- expectedParentNodeToString = "o = new <CompleteOnType:zzz>()";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " o = new <CompleteOnType:zzz>();\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0101(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0102(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0103(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0104(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " Object o;\n" +
- " o = \"yyy;\n" +
- " zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " Object o;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-
-public void test0105(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 1 + zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (1 + <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0106(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 1 + (zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 + <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (1 + <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0107(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 0;\n" +
- " int y = 1 + x;\n" +
- " zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x;\n" +
- " int y;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0108(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = -zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (- <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0109(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = -(zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(- <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x = (- <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0110(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int x = 0;\n" +
- " int y = -x;\n" +
- " zzz;\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " int x;\n" +
- " int y;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0111(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " if(1 == zzz) {}\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (1 == <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0112(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " if(1 == (zzz)) {}\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "(1 == <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " (1 == <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0113(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(Object x){\n" +
- " if(x instanceof ZZZ) {}\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "ZZZ";
- int cursorLocation = str.indexOf("ZZZ") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo(Object x) {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnType:ZZZ>";
- expectedParentNodeToString = "(x instanceof <CompleteOnType:ZZZ>)";
- completionIdentifier = "ZZZ";
- expectedReplacedSource = "ZZZ";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo(Object x) {\n" +
- " (x instanceof <CompleteOnType:ZZZ>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0114(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a == b ? zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "c = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " c = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0115(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b;\n" +
- " a == b ? zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0116(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a == b ? a : zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "c = ((a == b) ? a : <CompleteOnName:zzz>)";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " c = ((a == b) ? a : <CompleteOnName:zzz>);\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0117(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a == b ? a : (zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "c = <CompleteOnName:zzz>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " c = <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0118(){
- String str =
- "package p;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " boolean a, b, c;\n" +
- " c = a# == b ? a : zzz\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString = "<NONE>";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "package p;\n" +
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " boolean a;\n" +
- " boolean b;\n" +
- " boolean c;\n" +
- " <CompleteOnName:zzz>;\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0119(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " switch(1) {\n" +
- " case zzz\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-
- checkDietParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "diet ast");
-
- expectedCompletionNodeToString = "<CompleteOnName:zzz>";
- expectedParentNodeToString =
- "switch (1) {\n" +
- "case <CompleteOnName:zzz> : ;\n" +
- "}";
- completionIdentifier = "zzz";
- expectedReplacedSource = "zzz";
- expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " {\n" +
- " switch (1) {\n" +
- " case <CompleteOnName:zzz> : ;\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- checkMethodParse(
- str.toCharArray(),
- cursorLocation,
- expectedCompletionNodeToString,
- expectedParentNodeToString,
- expectedUnitDisplayString,
- completionIdentifier,
- expectedReplacedSource,
- "full ast");
-}
-public void test0120(){
- String str =
- "public class X {\n" +
- " void foo(){\n" +
- " switch(1) {\n" +
- " case Something :\n" +
- " case zzz\n" +
- " }\n" +
- " }\n" +
- "}\n";
-
- String completeBehind = "zzz";
- int cursorLocation = str.indexOf("zzz") + completeBehind.length() - 1;
-
- String expectedCompletionNodeToString = "<NONE>";
- String expectedParentNodeToString = "<NONE>";
- String completionIdentifier = "<NONE>";
- String expectedReplacedSource = "<NONE>";
- String expectedUnitDisplayString =
- "public class X {\n" +
- " public X() {\n" +
- " }\n" +
- " void foo() {\n" +
- " }\n" +
- "}\n";
-