Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 11:20:42 -0500
committerJonah Graham2018-11-22 16:47:02 -0500
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /core/org.eclipse.cdt.core.tests
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'core/org.eclipse.cdt.core.tests')
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorOldTests.java73
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java75
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/envvar/IEnvironmentVariableManagerTests.java142
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionProviderTestsProvider.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java132
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java127
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java605
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java71
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserTests.java25
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/FileBasedErrorParserTests.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java237
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GLDErrorParserTests.java102
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java44
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/MakeErrorParserTests.java78
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java163
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/AbstractDummyProvider.java7
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/DummyProviderTraces.java29
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/Providers.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/PositionTrackerTests.java662
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java151
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/StringBuilderTest.java67
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileStore.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileSystem.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryTree.java7
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/Policy.java7
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/preferences/tests/TestScopeOfBuildConfigResourceChangesPreference.java6
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java320
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusion.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusionFactory.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/winreg/tests/WinRegTests.java5
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/ByteUtilsTest.java272
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CdtVariableResolverTest.java136
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CommandLineUtilTest.java36
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/FindProgramLocationTest.java10
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java26
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/UNCPathConverterTest.java7
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java9
-rw-r--r--core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/elf/ElfParserTest.java6
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/AllLanguageTests.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/LanguageInheritanceTests.java66
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java83
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java346
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java209
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java405
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java78
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java110
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java236
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockLanguageSettingsEditableProvider.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockLanguageSettingsProvider.java3
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/MockListenerRegisterer.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ASTCacheTests.java113
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AllCoreTests.java40
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AllLanguageInterfaceTests.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ArchiveTests.java330
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/AsmModelBuilderTest.java75
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/BinaryTests.java728
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/Bug311189.java7
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderBugsTest.java32
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelBuilderInactiveCodeTest.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelElementsTests.java282
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelExceptionTest.java128
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelIdentifierTests.java47
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CModelTests.java1018
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/CPathEntryTest.java68
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/DeclaratorsTests.java153
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ElementDeltaTests.java160
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/FlagTests.java359
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IIncludeTests.java37
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IMacroTests.java59
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IStructureTests.java189
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/ITemplateTests.java353
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/IntegratedCModelTest.java20
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/MacroTests.java60
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/StructuralCModelElementsTests.java272
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/StructuralMacroTests.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/StructuralStructureTests.java59
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/StructuralTemplateTests.java195
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitBaseTest.java240
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java79
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/WorkingCopyTests.java66
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/AllCProjectDescriptionTests.java18
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/BackwardCompatibilityTests.java209
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CConfigurationDescriptionExportSettings.java141
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CConfigurationDescriptionReferenceTests.java141
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionBasicTests.java126
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionDeltaTests.java148
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CProjectDescriptionStorageTests.java40
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/CfgSettingsTests.java42
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java154
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/PathSettingsContainerTests.java52
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ProjectCreationStateTests.java113
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestCfgDataProvider.java32
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestExtSettingsProvider.java131
-rw-r--r--core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/TestUserAndDiscoveredEntriesCfgDataProvider.java19
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ASTComparer.java105
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ArrayUtilTest.java162
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java153
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CharArrayObjectMapTest.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CharArrayUtilsTest.java17
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ContentAssistMatcherFactoryTest.java9
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FileBasePluginTestCase.java124
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ObjectMapTest.java154
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ParserTestSuite.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/SegmentMatcherTest.java35
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/XMLDumper.java61
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPAttributeTests.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPImplicitNameTests.java50
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPSpecTest.java367
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTestBase.java6
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java1937
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CSpecTest.java184
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2FileBasePluginTestCase.java126
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java1204
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SelectionParseTest.java1606
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SelectionParseTestBase.java130
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2SpecTestBase.java167
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TemplateTests.java1072
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2TestBase.java426
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2Tests.java3129
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilOldTests.java671
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2UtilTests.java242
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTCPPSpecDefectTests.java22
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTInactiveCodeTests.java155
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ASTNodeSelectorTest.java428
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AccessControlTests.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CharArrayMapTest.java139
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CommentTests.java76
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/CompleteParser2Tests.java2595
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMFileBasePluginTest.java191
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMGCCParserExtensionTestSuite.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMGCCSelectionParseExtensionsTest.java13
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMLocationMacroTests.java872
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMLocationTests.java1374
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMParserTestSuite.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMPreprocessorInformationTest.java117
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMSearchUtil.java217
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMSelectionParseTest.java892
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/DOMSelectionParseTestBase.java25
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/FaultToleranceTests.java412
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCCompleteParseExtensionsTest.java468
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/GCCTests.java1557
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/ImageLocationTests.java98
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/LanguageExtensionsTest.java276
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/QuickParser2Tests.java2929
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/SemanticTestBase.java566
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/SemanticsTests.java39
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/TaskParserTest.java48
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/TestLexerLog.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/TypeTraitsTests.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/VariableReadWriteFlagsTest.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/GenericLambdaIndexTests.java16
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/GenericLambdaTests.java6
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/InitCaptureTests.java26
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/ReturnTypeDeductionIndexTests.java8
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/ReturnTypeDeductionTests.java62
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/VariableTemplateTests.java22
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/AllConstexprEvalTests.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/ArrayTests.java78
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/BinaryExpressionTests.java32
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/BinaryOperatorOverloadingTests.java52
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/CStringValueTests.java46
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/ClassTemplateTests.java48
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/ConstructorTests.java175
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/DoWhileStatementTests.java42
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FloatingPointValueTests.java56
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/ForStatementTests.java74
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FunctionTemplateTests.java114
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/FunctionTests.java100
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/IfStatementTests.java92
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/IntegralValueTests.java122
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/MemberFunctionTests.java66
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/MemberVariableTests.java88
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/PointerTests.java136
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/RangeBasedForStatementTests.java96
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/ReferenceTests.java38
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/SwitchStatementTests.java71
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TestBase.java10
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/TypeAliasTests.java30
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/UnaryExpressionTests.java94
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/UnaryOperatorOverloadingTests.java38
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/UserDefinedLiteralTests.java100
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx14/constexpr/WhileStatementTests.java46
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/cxx17/LambdaExpressionTests.java6
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/BasicCompletionTest.java144
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/CompletionTestBase.java108
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/prefix/CompletionTestSuite.java4
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteBaseTest.java23
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTester.java65
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/RewriteTests.java16
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/TestHelper.java14
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/TestSourceFile.java30
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/ASTWriterTest.java90
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/ASTWriterTestSourceFile.java18
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/AstWriterTestSuite.java42
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/ExpressionWriterTest.java314
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/astwriter/SourceRewriteTester.java35
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/AppendTests.java29
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ChangeGeneratorTest.java15
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ChangeGeneratorTestSuite.java14
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/CopyReplaceVisitor.java3
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/InsertBeforeTests.java32
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/RemoveTests.java14
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ReplaceTests.java79
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTest.java54
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/CommentHandlingTestSuite.java19
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/comenthandler/NodeCommentMapTest.java56
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ExpansionExplorerTests.java436
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/FileCharArrayTests.java34
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/FileCodeReaderFactory.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/InactiveCodeTests.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/InclusionTests.java474
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/LexerTests.java347
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/LocationMapTests.java284
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PortedScannerTests.java1742
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorBugsTests.java68
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorSpeedTest.java103
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorTests.java239
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/PreprocessorTestsBase.java77
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/ScannerTestSuite.java6
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/StreamHasherTests.java52
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner/TestMacro.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/Bug246129.java15
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/EmptyIndexFragment.java55
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBindingResolutionTestBase.java216
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java1043
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionBugs.java285
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCBindingResolutionTest.java129
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugs.java665
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionBugsSingleProjectFirstAST.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java470
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPTemplateResolutionTest.java1130
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPVariableTemplateResolutionTest.java48
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCompositeTests.java79
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexGPPBindingResolutionTest.java20
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexIncludeTest.java234
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexListenerTest.java37
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexLocationTest.java227
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexMultiFileTest.java17
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexMultiVariantHeaderTest.java8
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexNamesTests.java130
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexProviderManagerTest.java411
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexSearchTest.java128
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java19
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateTests.java272
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/ProjectBuilder.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TeamSharedIndexTest.java76
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TrilogyPerformanceTest.java16
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/BTreeExpensiveTests.java10
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/BTreeTests.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CCompositeTypeTests.java75
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CFunctionTests.java17
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPClassTemplateTests.java315
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPCompositeTypeTests.java42
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFieldTests.java29
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTemplateTests.java20
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPFunctionTests.java30
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CPPVariableTests.java5
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/CVariableTests.java7
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ChangeConfigurationTests.java55
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/ClassTests.java44
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DBPropertiesTests.java69
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DatabaseTest.java76
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/DefDeclTests.java53
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/EnumerationTests.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/FilesOnReindexTests.java15
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java293
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/IncludesTests.java10
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/MethodTests.java44
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/NamespaceTests.java14
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinCommonHeaderTests.java116
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/OverloadsWithinSingleTUTests.java33
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCBugsTest.java34
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMCPPBugsTest.java82
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMInlineCodeTestBase.java15
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMLocationTests.java32
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMNameTests.java19
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMPrettyPrinter.java16
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMProviderTests.java213
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMSearchTest.java9
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTagIndexTests.java16
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java42
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/RaceCondition157992Test.java23
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/TypesTests.java29
-rw-r--r--core/org.eclipse.cdt.core.tests/regression/org/eclipse/cdt/core/tests/BaseTestFramework.java134
-rw-r--r--core/org.eclipse.cdt.core.tests/regression/org/eclipse/cdt/core/tests/FailingTest.java84
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/ProjectCreator.java14
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CModelMock.java45
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CProjectHelper.java75
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CTestPlugin.java16
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/CTestSetup.java11
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/FileManager.java26
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/Main.java90
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/NewMain.java43
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/ResourceHelper.java76
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestPluginLauncher.java42
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestProject.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerInfo.java18
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/TestScannerProvider.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/AccessibilityTestPass.java12
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/BaseTestCase.java193
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/ExpectedStrings.java82
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/ExpectedStringsTests.java98
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/FailureDialog.java27
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/FocusTestPass.java8
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/IDialogTestPass.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/OneSourceMultipleHeadersTestCase.java24
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/TestSourceReader.java204
-rw-r--r--core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/testplugin/util/VerifyDialog.java98
310 files changed, 27396 insertions, 26408 deletions
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorOldTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorOldTests.java
index 98d46ebf787..06c5f2130d7 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorOldTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorOldTests.java
@@ -46,7 +46,7 @@ import org.w3c.dom.NodeList;
/**
* This class exists because the tests in CDescriptorTests
* are not fixed.
- * This class corresponds to the version of
+ * This class corresponds to the version of
* CDescrptorTests before the changes made in cdt.core 5.1
* (CVS version 1.12)
*/
@@ -59,7 +59,7 @@ public class CDescriptorOldTests extends TestCase {
/**
* Constructor for CDescriptorTest.
- *
+ *
* @param name
*/
public CDescriptorOldTests(String name) {
@@ -81,7 +81,7 @@ public class CDescriptorOldTests extends TestCase {
suite.addTest(new CDescriptorOldTests("testConcurrentDescriptorCreation2"));
suite.addTest(new CDescriptorOldTests("testDeadlockDuringProjectCreation"));
suite.addTest(new CDescriptorOldTests("testProjectStorageDelete"));
-
+
TestSetup wrapper = new TestSetup(suite) {
@Override
@@ -98,7 +98,8 @@ public class CDescriptorOldTests extends TestCase {
return wrapper;
}
- private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException {
+ private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor)
+ throws CoreException {
IProjectDescription description = proj.getDescription();
String[] prevNatures = description.getNatureIds();
String[] newNatures = new String[prevNatures.length + 1];
@@ -168,7 +169,7 @@ public class CDescriptorOldTests extends TestCase {
public void testConcurrentDescriptorCreation() throws Exception {
fProject.close(null);
fProject.open(null);
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
try {
@@ -180,57 +181,61 @@ public class CDescriptorOldTests extends TestCase {
t.start();
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
t.join();
-
+
Element data = desc.getProjectData("testElement0");
data.appendChild(data.getOwnerDocument().createElement("test"));
desc.saveProjectData();
fLastEvent = null;
- }
+ }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=185930
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=193503
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=196118
public void testConcurrentDescriptorCreation2() throws Exception {
int lastLength = 0;
- for (int i=0; i<200; ++i) {
+ for (int i = 0; i < 200; ++i) {
final int indexi = i;
- PDOMManager pdomMgr= (PDOMManager)CCorePlugin.getIndexManager();
+ PDOMManager pdomMgr = (PDOMManager) CCorePlugin.getIndexManager();
pdomMgr.shutdown();
fProject.close(null);
fProject.open(null);
pdomMgr.startup().schedule();
- ICDescriptor desc= CCorePlugin.getDefault().getCProjectDescription(fProject, true);
+ ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
if (lastLength == 0)
lastLength = countChildElements(desc.getProjectData("testElement"));
- final Throwable[] exception= new Throwable[10];
- Thread[] threads= new Thread[10];
+ final Throwable[] exception = new Throwable[10];
+ Thread[] threads = new Thread[10];
for (int j = 0; j < 10; j++) {
final int indexj = j;
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
try {
- ICDescriptorOperation operation= new ICDescriptorOperation() {
+ ICDescriptorOperation operation = new ICDescriptorOperation() {
@Override
- public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
+ public void execute(ICDescriptor descriptor, IProgressMonitor monitor)
+ throws CoreException {
assertFalse(descriptor.getConfigurationDescription().isReadOnly());
Element data = descriptor.getProjectData("testElement");
- String test = "test"+(indexi*10 + indexj);
+ String test = "test" + (indexi * 10 + indexj);
data.appendChild(data.getOwnerDocument().createElement(test));
assertFalse(descriptor.getConfigurationDescription().isReadOnly());
// BUG196118 the model cached in memory doesn't reflect the contents of .cproject
//
// descriptor.saveProjectData() doesn't actually save despite what the API says
// see CConfigBasedDescriptor.fApplyOnChange
-// ((CConfigBasedDescriptor)descriptor).apply(false);
-// System.out.println("Saved " + test);
- }};
- CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(fProject, operation, null);
- ICDescriptor descriptor = CCorePlugin.getDefault().getCDescriptorManager().getDescriptor(fProject);
- // perform apply outside descriptor operation to avoid deadlock - http://bugs.eclipse.org/241288
- descriptor.saveProjectData();
+ // ((CConfigBasedDescriptor)descriptor).apply(false);
+ // System.out.println("Saved " + test);
+ }
+ };
+ CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(fProject, operation,
+ null);
+ ICDescriptor descriptor = CCorePlugin.getDefault().getCDescriptorManager()
+ .getDescriptor(fProject);
+ // perform apply outside descriptor operation to avoid deadlock - http://bugs.eclipse.org/241288
+ descriptor.saveProjectData();
} catch (Throwable exc) {
- exception[indexj]= exc;
+ exception[indexj] = exc;
exc.printStackTrace();
}
}
@@ -242,9 +247,9 @@ public class CDescriptorOldTests extends TestCase {
if (threads[j] != null) {
threads[j].join();
}
- assertNull("Exception occurred: "+exception[j], exception[j]);
+ assertNull("Exception occurred: " + exception[j], exception[j]);
}
- desc= CCorePlugin.getDefault().getCProjectDescription(fProject, true);
+ desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
int lengthAfter = countChildElements(desc.getProjectData("testElement"));
lastLength += threads.length; // Update last lengths to what we expect
assertEquals("Iteration count: " + i, lastLength, lengthAfter);
@@ -254,7 +259,7 @@ public class CDescriptorOldTests extends TestCase {
}
/**
- * Count the number of Node.ELEMENT_NODE elements which are a
+ * Count the number of Node.ELEMENT_NODE elements which are a
* direct descendent of the parent Element.
* Other nodes (e.g. Text) are ignored
* @param parent
@@ -263,17 +268,17 @@ public class CDescriptorOldTests extends TestCase {
private int countChildElements(Element parent) {
int numElements = 0;
NodeList childNodes = parent.getChildNodes();
- for (int k = 0 ; k < childNodes.getLength() ; k++)
+ for (int k = 0; k < childNodes.getLength(); k++)
if (childNodes.item(k).getNodeType() == Node.ELEMENT_NODE)
- numElements ++;
+ numElements++;
return numElements;
}
public void testDeadlockDuringProjectCreation() throws Exception {
- for (int i=0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
oneTimeTearDown();
oneTimeSetUp();
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
try {
@@ -292,10 +297,10 @@ public class CDescriptorOldTests extends TestCase {
data.appendChild(data.getOwnerDocument().createElement("test"));
desc.saveProjectData();
t.join();
-
+
fLastEvent = null;
}
- }
+ }
public void testDescriptorOwner() throws Exception {
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
@@ -404,7 +409,7 @@ public class CDescriptorOldTests extends TestCase {
// 3rd check the item no longer exists
desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
data = desc.getProjectData("testElement");
- assertTrue(data.getChildNodes().getLength() == 0);
+ assertTrue(data.getChildNodes().getLength() == 0);
fLastEvent = null;
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java
index 4d5dafbf472..93cb50ddf25 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java
@@ -102,7 +102,8 @@ public class CDescriptorTests extends BaseTestCase {
fProject.delete(true, true, null);
}
- private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor) throws CoreException {
+ private static void addNatureToProject(IProject proj, String natureId, IProgressMonitor monitor)
+ throws CoreException {
IProjectDescription description = proj.getDescription();
String[] prevNatures = description.getNatureIds();
String[] newNatures = new String[prevNatures.length + 1];
@@ -143,10 +144,10 @@ public class CDescriptorTests extends BaseTestCase {
// Disabled this test because it fails every now and then and it tests deprecated API
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=340123
public void _testConcurrentDescriptorCreation() throws Exception {
- for (int i = 0; i < 100 ; i++) {
+ for (int i = 0; i < 100; i++) {
fProject.close(null);
fProject.open(null);
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
try {
@@ -168,7 +169,7 @@ public class CDescriptorTests extends BaseTestCase {
desc.saveProjectData();
fLastEvent = null;
}
- }
+ }
/*
* This tests concurrent descriptor modification inside of a ICDescriptor operation run
@@ -180,38 +181,41 @@ public class CDescriptorTests extends BaseTestCase {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=196118
public void testConcurrentDescriptorModification() throws Exception {
int lastLength = 0;
- for (int i= 0; i < 100; ++i) {
+ for (int i = 0; i < 100; ++i) {
final int indexi = i;
- PDOMManager pdomMgr= (PDOMManager)CCorePlugin.getIndexManager();
+ PDOMManager pdomMgr = (PDOMManager) CCorePlugin.getIndexManager();
pdomMgr.shutdown();
fProject.close(null);
fProject.open(null);
pdomMgr.startup().schedule();
- final ICDescriptor fdesc= CCorePlugin.getDefault().getCProjectDescription(fProject, true);
+ final ICDescriptor fdesc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
if (lastLength == 0)
lastLength = fdesc.getProjectStorageElement("testElement").getChildren().length;
- final Throwable[] exception= new Throwable[10];
- Thread[] threads= new Thread[10];
+ final Throwable[] exception = new Throwable[10];
+ Thread[] threads = new Thread[10];
for (int j = 0; j < 10; j++) {
final int indexj = j;
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
try {
- ICDescriptorOperation operation= new ICDescriptorOperation() {
+ ICDescriptorOperation operation = new ICDescriptorOperation() {
@Override
- public void execute(ICDescriptor descriptor, IProgressMonitor monitor) throws CoreException {
-// assertFalse(descriptor.getConfigurationDescription().isReadOnly());
+ public void execute(ICDescriptor descriptor, IProgressMonitor monitor)
+ throws CoreException {
+ // assertFalse(descriptor.getConfigurationDescription().isReadOnly());
ICStorageElement data = fdesc.getProjectStorageElement("testElement");
- String test = "test"+(indexi*10 + indexj);
+ String test = "test" + (indexi * 10 + indexj);
data.createChild(test);
-// assertFalse(descriptor.getConfigurationDescription().isReadOnly());
+ // assertFalse(descriptor.getConfigurationDescription().isReadOnly());
descriptor.saveProjectData();
-// System.out.println("Saved " + test);
- }};
- CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(fProject, operation, null);
+ // System.out.println("Saved " + test);
+ }
+ };
+ CCorePlugin.getDefault().getCDescriptorManager().runDescriptorOperation(fProject, operation,
+ null);
} catch (Throwable exc) {
- exception[indexj]= exc;
+ exception[indexj] = exc;
exc.printStackTrace();
}
}
@@ -226,9 +230,9 @@ public class CDescriptorTests extends BaseTestCase {
} catch (InterruptedException e) {
}
}
- assertNull("Exception occurred: "+exception[j], exception[j]);
+ assertNull("Exception occurred: " + exception[j], exception[j]);
}
- ICDescriptor desc= CCorePlugin.getDefault().getCProjectDescription(fProject, true);
+ ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
int lengthAfter = desc.getProjectStorageElement("testElement").getChildren().length;
lastLength += threads.length; // Update last lengths to what we expect
assertEquals("Iteration count: " + i, lastLength, lengthAfter);
@@ -242,8 +246,8 @@ public class CDescriptorTests extends BaseTestCase {
* (outside of an operation) should be safe.
*/
public void testConcurrentDifferentStorageElementModification() throws Exception {
- for (int i= 0; i < 100; ++i) {
- Thread t= new Thread() {
+ for (int i = 0; i < 100; ++i) {
+ Thread t = new Thread() {
@Override
public void run() {
try {
@@ -269,16 +273,18 @@ public class CDescriptorTests extends BaseTestCase {
fLastEvent = null;
}
- Assert.assertEquals(100, CCorePlugin.getDefault().getCProjectDescription(fProject, false).getProjectStorageElement("testElement4").getChildren().length);
- Assert.assertEquals(100, CCorePlugin.getDefault().getCProjectDescription(fProject, false).getProjectStorageElement("testElement5").getChildren().length);
- }
+ Assert.assertEquals(100, CCorePlugin.getDefault().getCProjectDescription(fProject, false)
+ .getProjectStorageElement("testElement4").getChildren().length);
+ Assert.assertEquals(100, CCorePlugin.getDefault().getCProjectDescription(fProject, false)
+ .getProjectStorageElement("testElement5").getChildren().length);
+ }
/*
* Tests that (non-structural) changes to the storage element tree work as expected.
*/
public void testConcurrentSameStorageElementModification() throws Exception {
- for (int i= 0; i < 100; ++i) {
- Thread t= new Thread() {
+ for (int i = 0; i < 100; ++i) {
+ Thread t = new Thread() {
@Override
public void run() {
try {
@@ -304,17 +310,18 @@ public class CDescriptorTests extends BaseTestCase {
fLastEvent = null;
}
- Assert.assertEquals(200, CCorePlugin.getDefault().getCProjectDescription(fProject, false).getProjectStorageElement("testElement6").getChildren().length);
- }
+ Assert.assertEquals(200, CCorePlugin.getDefault().getCProjectDescription(fProject, false)
+ .getProjectStorageElement("testElement6").getChildren().length);
+ }
/*
* Tests deadlock when accessing c project description concurrently from two threads
*/
public void testDeadlockDuringProjectCreation() throws Exception {
- for (int i= 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
tearDown();
setUp();
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
try {
@@ -339,7 +346,7 @@ public class CDescriptorTests extends BaseTestCase {
fLastEvent = null;
}
- }
+ }
public void testDescriptorConversion() {
}
@@ -431,7 +438,7 @@ public class CDescriptorTests extends BaseTestCase {
}
public void testCProjectDescriptionDescriptorInteraction() throws Exception {
- for (int i = 1; i < 100 ; i++) {
+ for (int i = 1; i < 100; i++) {
// Create a descriptor with some test data
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
ICStorageElement data = desc.getProjectStorageElement("descDescInteraction");
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/envvar/IEnvironmentVariableManagerTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/envvar/IEnvironmentVariableManagerTests.java
index 0bb112f2672..031650d4400 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/envvar/IEnvironmentVariableManagerTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/envvar/IEnvironmentVariableManagerTests.java
@@ -48,13 +48,16 @@ public class IEnvironmentVariableManagerTests extends TestCase {
public int getCount() {
return count;
}
+
public void resetCount() {
count = 0;
lastEvent = null;
}
+
public IEnvironmentChangeEvent getLastEvent() {
return lastEvent;
}
+
@Override
public void handleEvent(IEnvironmentChangeEvent event) {
count++;
@@ -73,8 +76,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
}
public static Test suite() {
- TestSuite suite = new TestSuite(IEnvironmentVariableManagerTests.class);
- return suite;
+ TestSuite suite = new TestSuite(IEnvironmentVariableManagerTests.class);
+ return suite;
}
/**
@@ -88,8 +91,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
// Add another, derived configuration
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
- final String id1 = desc.getId(); // Config 1's ID
- final String id2 = CDataUtil.genId(id1); // Config 2's ID
+ final String id1 = desc.getId(); // Config 1's ID
+ final String id2 = CDataUtil.genId(id1); // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -142,7 +145,7 @@ public class IEnvironmentVariableManagerTests extends TestCase {
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
final String id1 = desc.getId(); // Config 1's ID
- final String id2 = "712427638"; // Config 2's ID
+ final String id2 = "712427638"; // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -152,14 +155,14 @@ public class IEnvironmentVariableManagerTests extends TestCase {
contribEnv.addVariable(varOrig, prjDesc.getConfigurationById(id2));
CoreModel.getDefault().setProjectDescription(project, prjDesc);
- final String env = "#Mon Nov 16 21:47:46 GMT 2009\n" +
- "eclipse.preferences.version=1\n" +
- "environment/project/712427638=<?xml version\\=\"1.0\" encoding\\=\"UTF-8\" standalone\\=\"no\"?>\\n" +
- "<environment append\\=\"true\" appendContributed\\=\"true\">\\n" +
- "<variable delimiter\\=\"\\:\" name\\=\"FOO1\" operation\\=\"replace\" value\\=\"BAR1\"/>\\n" +
- "<variable delimiter\\=\"\\:\" name\\=\"FOO2\" operation\\=\"replace\" value\\=\"BAR2\"/>\\n" +
- "<variable delimiter\\=\"\\;\" name\\=\"FOO\" operation\\=\"append\" value\\=\"BAR\"/>\\n</environment>\n";
- project.getFile(".settings/org.eclipse.cdt.core.prefs").setContents(new ByteArrayInputStream(env.getBytes("UTF-8")), true, false, null);
+ final String env = "#Mon Nov 16 21:47:46 GMT 2009\n" + "eclipse.preferences.version=1\n"
+ + "environment/project/712427638=<?xml version\\=\"1.0\" encoding\\=\"UTF-8\" standalone\\=\"no\"?>\\n"
+ + "<environment append\\=\"true\" appendContributed\\=\"true\">\\n"
+ + "<variable delimiter\\=\"\\:\" name\\=\"FOO1\" operation\\=\"replace\" value\\=\"BAR1\"/>\\n"
+ + "<variable delimiter\\=\"\\:\" name\\=\"FOO2\" operation\\=\"replace\" value\\=\"BAR2\"/>\\n"
+ + "<variable delimiter\\=\"\\;\" name\\=\"FOO\" operation\\=\"append\" value\\=\"BAR\"/>\\n</environment>\n";
+ project.getFile(".settings/org.eclipse.cdt.core.prefs")
+ .setContents(new ByteArrayInputStream(env.getBytes("UTF-8")), true, false, null);
final IEnvironmentVariable var = new EnvironmentVariable("FOO", "BAR", IEnvironmentVariable.ENVVAR_APPEND, ";");
final IEnvironmentVariable var1 = new EnvironmentVariable("FOO1", "BAR1", ":");
@@ -182,7 +185,7 @@ public class IEnvironmentVariableManagerTests extends TestCase {
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
final String id1 = desc.getId(); // Config 1's ID
- final String id2 = "712427638"; // Config 2's ID
+ final String id2 = "712427638"; // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -192,20 +195,21 @@ public class IEnvironmentVariableManagerTests extends TestCase {
contribEnv.addVariable(varOrig, prjDesc.getConfigurationById(id2));
CoreModel.getDefault().setProjectDescription(project, prjDesc);
- final String env = "#Mon Nov 16 21:47:46 GMT 2009\n" +
- "eclipse.preferences.version=1\n" +
- "environment/project/712427638=<?xml version\\=\"1.0\" encoding\\=\"UTF-8\" standalone\\=\"no\"?>\\n" +
- "<environment append\\=\"true\" appendContributed\\=\"true\">\\n" +
- "<variable delimiter\\=\"\\:\" name\\=\"FOO1\" operation\\=\"replace\" value\\=\"BAR1\"/>\\n" +
- "<variable delimiter\\=\"\\:\" name\\=\"FOO2\" operation\\=\"replace\" value\\=\"BAR2\"/>\\n" +
- "<variable delimiter\\=\"\\;\" name\\=\"FOO\" operation\\=\"append\" value\\=\"BAR\"/>\\n</environment>\n";
- project.getFile(".settings/org.eclipse.cdt.core.prefs").setContents(new ByteArrayInputStream(env.getBytes("UTF-8")), true, false, null);
+ final String env = "#Mon Nov 16 21:47:46 GMT 2009\n" + "eclipse.preferences.version=1\n"
+ + "environment/project/712427638=<?xml version\\=\"1.0\" encoding\\=\"UTF-8\" standalone\\=\"no\"?>\\n"
+ + "<environment append\\=\"true\" appendContributed\\=\"true\">\\n"
+ + "<variable delimiter\\=\"\\:\" name\\=\"FOO1\" operation\\=\"replace\" value\\=\"BAR1\"/>\\n"
+ + "<variable delimiter\\=\"\\:\" name\\=\"FOO2\" operation\\=\"replace\" value\\=\"BAR2\"/>\\n"
+ + "<variable delimiter\\=\"\\;\" name\\=\"FOO\" operation\\=\"append\" value\\=\"BAR\"/>\\n</environment>\n";
+ project.getFile(".settings/org.eclipse.cdt.core.prefs")
+ .setContents(new ByteArrayInputStream(env.getBytes("UTF-8")), true, false, null);
ISchedulingRule incompatibleRule = new ISchedulingRule() {
@Override
public boolean isConflicting(ISchedulingRule rule) {
return rule == this || rule instanceof IResource;
}
+
@Override
public boolean contains(ISchedulingRule rule) {
return rule == this;
@@ -213,10 +217,11 @@ public class IEnvironmentVariableManagerTests extends TestCase {
};
try {
Job.getJobManager().beginRule(incompatibleRule, new NullProgressMonitor());
- final IEnvironmentVariable var = new EnvironmentVariable("FOO", "BAR", IEnvironmentVariable.ENVVAR_APPEND, ";");
+ final IEnvironmentVariable var = new EnvironmentVariable("FOO", "BAR", IEnvironmentVariable.ENVVAR_APPEND,
+ ";");
final IEnvironmentVariable var1 = new EnvironmentVariable("FOO1", "BAR1", ":");
final IEnvironmentVariable var2 = new EnvironmentVariable("FOO2", "BAR2", ":");
-
+
prjDesc = CoreModel.getDefault().getProjectDescription(project);
assertEquals(var, envManager.getVariable(var.getName(), prjDesc.getConfigurationById(id2), true));
assertEquals(var1, envManager.getVariable(var1.getName(), prjDesc.getConfigurationById(id2), true));
@@ -247,7 +252,7 @@ public class IEnvironmentVariableManagerTests extends TestCase {
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
final String id1 = desc.getId(); // Config 1's ID
- final String id2 = "712427638"; // Config 2's ID
+ final String id2 = "712427638"; // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -258,18 +263,17 @@ public class IEnvironmentVariableManagerTests extends TestCase {
contribEnv.addVariable(varOrig, prjDesc.getConfigurationById(id2));
CoreModel.getDefault().setProjectDescription(project, prjDesc);
- final String env = "environment/project/712427638/FOO/delimiter=;\n" +
- "environment/project/712427638/FOO/operation=append\n" +
- "environment/project/712427638/FOO/value=BAR\n" +
- "environment/project/712427638/FOO1/delimiter=\\:\n" +
- "environment/project/712427638/FOO1/operation=replace\n" +
- "environment/project/712427638/FOO1/value=BAR1\n" +
- "environment/project/712427638/FOO2/delimiter=\\:\n" +
- "environment/project/712427638/FOO2/operation=replace\n" +
- "environment/project/712427638/FOO2/value=BAR2\n" +
- "environment/project/712427638/append=true\n" +
- "environment/project/712427638/appendContributed=true\n";
- project.getFile(".settings/org.eclipse.cdt.core.prefs").setContents(new ByteArrayInputStream(env.getBytes("UTF-8")), true, false, null);
+ final String env = "environment/project/712427638/FOO/delimiter=;\n"
+ + "environment/project/712427638/FOO/operation=append\n"
+ + "environment/project/712427638/FOO/value=BAR\n" + "environment/project/712427638/FOO1/delimiter=\\:\n"
+ + "environment/project/712427638/FOO1/operation=replace\n"
+ + "environment/project/712427638/FOO1/value=BAR1\n"
+ + "environment/project/712427638/FOO2/delimiter=\\:\n"
+ + "environment/project/712427638/FOO2/operation=replace\n"
+ + "environment/project/712427638/FOO2/value=BAR2\n" + "environment/project/712427638/append=true\n"
+ + "environment/project/712427638/appendContributed=true\n";
+ project.getFile(".settings/org.eclipse.cdt.core.prefs")
+ .setContents(new ByteArrayInputStream(env.getBytes("UTF-8")), true, false, null);
final IEnvironmentVariable var = new EnvironmentVariable("FOO", "BAR", IEnvironmentVariable.ENVVAR_APPEND, ";");
final IEnvironmentVariable var1 = new EnvironmentVariable("FOO1", "BAR1", ":");
@@ -346,8 +350,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
// Add another, derived configuration
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
- final String id1 = desc.getId(); // Config 1's ID
- final String id2 = CDataUtil.genId(id1); // Config 2's ID
+ final String id1 = desc.getId(); // Config 1's ID
+ final String id2 = CDataUtil.genId(id1); // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -389,8 +393,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
// Add another, derived configuration
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
- final String id1 = desc.getId(); // Config 1's ID
- final String id2 = CDataUtil.genId(id1); // Config 2's ID
+ final String id1 = desc.getId(); // Config 1's ID
+ final String id2 = CDataUtil.genId(id1); // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -413,8 +417,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
CoreModel.getDefault().setProjectDescription(project, prjDesc);
// Backup the settings file
- project.getFile(".settings/org.eclipse.cdt.core.prefs.bak").create(
- project.getFile(".settings/org.eclipse.cdt.core.prefs").getContents(), true, null);
+ project.getFile(".settings/org.eclipse.cdt.core.prefs.bak")
+ .create(project.getFile(".settings/org.eclipse.cdt.core.prefs").getContents(), true, null);
// Change the environment variable
final IEnvironmentVariable var2 = new EnvironmentVariable("FOO", "BOO");
@@ -438,8 +442,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
// Add another, derived configuration
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
ICConfigurationDescription desc = prjDesc.getActiveConfiguration();
- final String id1 = desc.getId(); // Config 1's ID
- final String id2 = CDataUtil.genId(id1); // Config 2's ID
+ final String id1 = desc.getId(); // Config 1's ID
+ final String id2 = CDataUtil.genId(id1); // Config 2's ID
prjDesc.createConfiguration(id2, "config2", desc);
CoreModel.getDefault().setProjectDescription(project, prjDesc);
@@ -462,8 +466,8 @@ public class IEnvironmentVariableManagerTests extends TestCase {
CoreModel.getDefault().setProjectDescription(project, prjDesc);
// Backup the settings file
- project.getFile(".settings/org.eclipse.cdt.core.prefs.bak").create(
- project.getFile(".settings/org.eclipse.cdt.core.prefs").getContents(), true, null);
+ project.getFile(".settings/org.eclipse.cdt.core.prefs.bak")
+ .create(project.getFile(".settings/org.eclipse.cdt.core.prefs").getContents(), true, null);
// Change the environment variable
final IEnvironmentVariable var2 = new EnvironmentVariable("FOO", "BOO");
@@ -473,13 +477,15 @@ public class IEnvironmentVariableManagerTests extends TestCase {
// clean desc should be updated when the preference file is overwritten
final ICProjectDescription cleanDesc = CoreModel.getDefault().getProjectDescription(project);
- assertEquals(contribEnv.getVariable(var.getName(), cleanDesc.getConfigurationById(id1)).getValue(), var2.getValue());
+ assertEquals(contribEnv.getVariable(var.getName(), cleanDesc.getConfigurationById(id1)).getValue(),
+ var2.getValue());
// Replace the settings with it's backup
project.getFile(".settings/org.eclipse.cdt.core.prefs").setContents(
project.getFile(".settings/org.eclipse.cdt.core.prefs.bak").getContents(), true, false, null);
// check that cleanDesc has been updated
- assertEquals(contribEnv.getVariable(var.getName(), cleanDesc.getConfigurationById(id1)).getValue(), var.getValue());
+ assertEquals(contribEnv.getVariable(var.getName(), cleanDesc.getConfigurationById(id1)).getValue(),
+ var.getValue());
assertEquals(var, envManager.getVariable(var.getName(), cleanDesc.getConfigurationById(id1), true));
}
@@ -608,7 +614,7 @@ public class IEnvironmentVariableManagerTests extends TestCase {
/**
* This test checks if an environment variable is only processed as a list
* if it matches a certain pattern. ([^:]+:)+[^:]* (; on Windows)
- *
+ *
* If a variable is a list, it is split into a String array depending on the
* delimiter given. At some point, this array is used to build a new
* String representing the list, separated by the delimiter. This should
@@ -616,10 +622,10 @@ public class IEnvironmentVariableManagerTests extends TestCase {
* variable has a value of ':' without the quotes, it shouldn't processed as
* a list even if it contains a delimiter because if it was, it would give
* an empty string when built since there are no items in the list.
- *
+ *
* @throws Exception
*/
- public void testBug284843() throws Exception{
+ public void testBug284843() throws Exception {
final IProject project = ResourceHelper.createCDTProjectWithConfig("envProject");
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project);
IEnvironmentVariableManager envManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
@@ -628,50 +634,48 @@ public class IEnvironmentVariableManagerTests extends TestCase {
String delimiter = System.getProperty("path.separator");
// Create the test variables
- IEnvironmentVariable varDelim = new EnvironmentVariable("DELIM",
- delimiter);
+ IEnvironmentVariable varDelim = new EnvironmentVariable("DELIM", delimiter);
String varListValue = "value1" + delimiter + "value2" + delimiter + "value3";
IEnvironmentVariable varList = new EnvironmentVariable("LIST", varListValue);
- IEnvironmentVariable varListDelim = new EnvironmentVariable("LISTDELIM",
- "value1" + delimiter);
- IEnvironmentVariable varListDelims = new EnvironmentVariable("LISTDELIMS",
- varListValue + delimiter);
- String varInvalidListValue = delimiter + "value1" + delimiter + "value2" + delimiter + delimiter + "value3" + delimiter;
+ IEnvironmentVariable varListDelim = new EnvironmentVariable("LISTDELIM", "value1" + delimiter);
+ IEnvironmentVariable varListDelims = new EnvironmentVariable("LISTDELIMS", varListValue + delimiter);
+ String varInvalidListValue = delimiter + "value1" + delimiter + "value2" + delimiter + delimiter + "value3"
+ + delimiter;
IEnvironmentVariable varInvalidList = new EnvironmentVariable("INVALIDLIST", varInvalidListValue);
-
+
// Add the variables to the contributed environment
contribEnv.addVariable(varDelim, confDesc);
contribEnv.addVariable(varList, confDesc);
contribEnv.addVariable(varListDelim, confDesc);
contribEnv.addVariable(varListDelims, confDesc);
contribEnv.addVariable(varInvalidList, confDesc);
-
+
// Get the processed variables
varDelim = envManager.getVariable(varDelim.getName(), confDesc, true);
varList = envManager.getVariable(varList.getName(), confDesc, true);
varListDelim = envManager.getVariable(varListDelim.getName(), confDesc, true);
varListDelims = envManager.getVariable(varListDelims.getName(), confDesc, true);
varInvalidList = envManager.getVariable(varInvalidList.getName(), confDesc, true);
-
+
// Should keep the same value, not a list
assertEquals(delimiter, varDelim.getValue());
-
+
// Should keep the same value, processed as a list
assertEquals(varListValue, varList.getValue());
-
+
// The delimiter will be trimmed, processed as a list
assertEquals("value1", varListDelim.getValue());
-
+
// The last delimiter will be trimmed, processed as a list
- assertEquals(varListValue, varListDelims.getValue());
-
+ assertEquals(varListValue, varListDelims.getValue());
+
// Should keep the same value, not a list
- assertEquals(varInvalidListValue,varInvalidList.getValue());
+ assertEquals(varInvalidListValue, varInvalidList.getValue());
}
/**
* Test case to test environment variable change notifications
- *
+ *
* @throws Exception
*/
public void testEnvironmentChangeListener() throws Exception {
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionProviderTestsProvider.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionProviderTestsProvider.java
index 447af854e8e..8f6a3d63910 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionProviderTestsProvider.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionProviderTestsProvider.java
@@ -21,7 +21,7 @@ import org.eclipse.cdt.core.EFSExtensionProvider;
* Test class that is used to make sure that extensions to the EFSExtensionProvider
* extension point are picked up. Overrrides the default behaviour for isVirtual()
* to return true.
- *
+ *
* @author crecoskie
*
*/
@@ -32,6 +32,4 @@ public class EFSExtensionProviderTestsProvider extends EFSExtensionProvider {
return true;
}
-
-
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java
index 790d1a65c23..45febb88d08 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/efsextension/tests/EFSExtensionTests.java
@@ -27,7 +27,7 @@ import org.eclipse.core.runtime.Platform;
/**
* Tests the EFSExtensionManager and EFSExtensionProvider classes, as well as the EFSExtensionProvider extension point.
- *
+ *
* @author crecoskie
*
*/
@@ -41,16 +41,14 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
- String workingDirPath = EFSExtensionManager.getDefault()
- .getPathFromURI(originalURI);
+ String workingDirPath = EFSExtensionManager.getDefault().getPathFromURI(originalURI);
IPath path = new Path("subdirectory");
IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath.toString());
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath.toString());
+
assertEquals(expected, uri);
}
-
+
public void testReplaceInUNIXURI() {
URI originalURI = null;
URI expected = null;
@@ -60,16 +58,14 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
- String workingDirPath = EFSExtensionManager.getDefault()
- .getPathFromURI(originalURI);
+ String workingDirPath = EFSExtensionManager.getDefault().getPathFromURI(originalURI);
IPath path = new Path("subdirectory");
IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath.toString());
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath.toString());
+
assertEquals(expected, uri);
}
-
+
public void testReplaceInWindowsURI() {
URI originalURI = null;
URI expected = null;
@@ -79,16 +75,14 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
- String workingDirPath = EFSExtensionManager.getDefault()
- .getPathFromURI(originalURI);
+ String workingDirPath = EFSExtensionManager.getDefault().getPathFromURI(originalURI);
IPath path = new Path("subdirectory");
IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath.toString());
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath.toString());
+
assertEquals(expected, uri);
}
-
+
public void testReplaceInMadeUpURI() {
URI originalURI = null;
URI expected = null;
@@ -98,26 +92,23 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
- String workingDirPath = EFSExtensionManager.getDefault()
- .getPathFromURI(originalURI);
+ String workingDirPath = EFSExtensionManager.getDefault().getPathFromURI(originalURI);
IPath path = new Path("subdirectory");
IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath.toString());
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath.toString());
+
assertEquals(expected, uri);
}
-
+
public void testReplaceWithWindowsPathNoLeadingSlash() {
URI originalURI = null;
URI expected = null;
try {
originalURI = new URI("file", "/c:/foo", null);
-
- if(java.io.File.separatorChar == '\\') {
+
+ if (java.io.File.separatorChar == '\\') {
expected = new URI("file", "/c:/foo/subdirectory", null);
- }
- else {
+ } else {
// if we're not on Windows then backslash is not the path separator, and instead
// is a valid filename character. Using a backslash will result in it being escaped.
expected = new URI("file", "/c:\\foo\\subdirectory", null);
@@ -125,52 +116,49 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
String newPath = "c:\\foo\\subdirectory";
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath);
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath);
+
assertEquals(expected, uri);
}
-
+
public void testReplaceURIWithAuthority() {
URI originalURI = null;
URI expected = null;
try {
originalURI = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie", null, null);
- expected = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie/subdirectory", null, null);
+ expected = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie/subdirectory", null,
+ null);
} catch (URISyntaxException e) {
fail(e.getMessage());
}
- String workingDirPath = EFSExtensionManager.getDefault()
- .getPathFromURI(originalURI);
+ String workingDirPath = EFSExtensionManager.getDefault().getPathFromURI(originalURI);
IPath path = new Path("subdirectory");
IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath.toString());
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath.toString());
+
assertEquals(expected, uri);
}
-
+
public void testReplaceURIWithAuthority2() {
URI originalURI = null;
URI expected = null;
try {
originalURI = new URI("rse", "recoskie@dbgaix3.torolab.ibm.com:1000", "/home/recoskie", null, null);
- expected = new URI("rse", "recoskie", "dbgaix3.torolab.ibm.com", 1000, "/home/recoskie/subdirectory", null, null);
+ expected = new URI("rse", "recoskie", "dbgaix3.torolab.ibm.com", 1000, "/home/recoskie/subdirectory", null,
+ null);
} catch (URISyntaxException e) {
fail(e.getMessage());
}
- String workingDirPath = EFSExtensionManager.getDefault()
- .getPathFromURI(originalURI);
+ String workingDirPath = EFSExtensionManager.getDefault().getPathFromURI(originalURI);
IPath path = new Path("subdirectory");
IPath newPath = new Path(workingDirPath).append(path).makeAbsolute();
- URI uri = EFSExtensionManager.getDefault()
- .createNewURIFromPath(originalURI, newPath.toString());
-
+ URI uri = EFSExtensionManager.getDefault().createNewURIFromPath(originalURI, newPath.toString());
+
assertEquals(expected, uri);
- }
-
+ }
+
public void testAppendinRSEURI() {
URI originalURI = null;
URI expected = null;
@@ -180,12 +168,12 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
URI uri = EFSExtensionManager.getDefault().append(originalURI, "subdirectory");
-
+
assertEquals(expected, uri);
}
-
+
public void testAppendToUNIXURI() {
URI originalURI = null;
URI expected = null;
@@ -195,12 +183,12 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
URI uri = EFSExtensionManager.getDefault().append(originalURI, "subdirectory");
-
+
assertEquals(expected, uri);
}
-
+
public void testAppendToWindowsURI() {
URI originalURI = null;
URI expected = null;
@@ -210,67 +198,67 @@ public class EFSExtensionTests extends TestCase {
} catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
URI uri = EFSExtensionManager.getDefault().append(originalURI, "subdirectory");
-
+
assertEquals(expected, uri);
}
-
+
public void testGetLinkedURI() {
URI originalURI = null;
try {
originalURI = new URI("file", "/c:/foo", null);
- } catch(URISyntaxException e) {
+ } catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
URI uri = EFSExtensionManager.getDefault().getLinkedURI(originalURI);
-
+
assertEquals(originalURI, uri);
}
-
+
public void testGetMappedPath() {
URI originalURI = null;
try {
originalURI = new URI("file", "/c:/foo", null);
- } catch(URISyntaxException e) {
+ } catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
String path = EFSExtensionManager.getDefault().getMappedPath(originalURI);
-
+
if (Platform.getOS().equals(Platform.WS_WIN32)) {
assertEquals(path, "c:/foo");
} else {
assertEquals(path, "/c:/foo");
}
}
-
+
public void testGetPathFromURI() {
URI originalURI = null;
try {
originalURI = new URI("file", "/c:/foo", null);
- } catch(URISyntaxException e) {
+ } catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
String path = EFSExtensionManager.getDefault().getMappedPath(originalURI);
-
+
if (Platform.getOS().equals(Platform.WS_WIN32)) {
assertEquals(path, "c:/foo");
} else {
assertEquals(path, "/c:/foo");
}
}
-
+
public void testExtension() {
URI originalURI = null;
try {
originalURI = new URI("EFSExtensionProviderTestsScheme", "/some/silly/path", null);
- } catch(URISyntaxException e) {
+ } catch (URISyntaxException e) {
fail(e.getMessage());
}
-
+
assertTrue(EFSExtensionManager.getDefault().isVirtual(originalURI));
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java
index c64b0957293..2455514acc8 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserEfsFileMatchingTest.java
@@ -58,7 +58,8 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
private final IMarkerGenerator markerGenerator = new IMarkerGenerator() {
// deprecated
@Override
- public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {}
+ public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
+ }
@Override
public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
@@ -75,8 +76,7 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
*/
public MockErrorParser() {
super(new ErrorPattern[] {
- new ErrorPattern("(.*):(.*):(.*)", 1, 2, 3, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE)
- });
+ new ErrorPattern("(.*):(.*):(.*)", 1, 2, 3, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) });
}
}
@@ -91,7 +91,7 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
@Override
protected void setUp() throws Exception {
- if (fProject==null) {
+ if (fProject == null) {
fProject = ResourceHelper.createCDTProject(testName);
Assert.assertNotNull(fProject);
mockErrorParserId = addErrorParserExtension("MockErrorParser", MockErrorParser.class);
@@ -187,7 +187,7 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
* Convenience method to parse one line of output.
*/
private void parseOutput(IProject project, String buildDir, String line) throws Exception {
- parseOutput(project, new Path(buildDir), new String[] {mockErrorParserId}, line);
+ parseOutput(project, new Path(buildDir), new String[] { mockErrorParserId }, line);
}
/**
@@ -195,7 +195,7 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
* Search is done in project location.
*/
private void parseOutput(IProject project, String line) throws Exception {
- parseOutput(project, project.getLocation(), new String[] {mockErrorParserId}, line);
+ parseOutput(project, project.getLocation(), new String[] { mockErrorParserId }, line);
}
/**
@@ -203,7 +203,7 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
* Search is done for current project in default location.
*/
private void parseOutput(String line) throws Exception {
- parseOutput(fProject, fProject.getLocation(), new String[] {mockErrorParserId}, line);
+ parseOutput(fProject, fProject.getLocation(), new String[] { mockErrorParserId }, line);
}
/**
@@ -217,8 +217,8 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/testSingle.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/testSingle.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -233,8 +233,8 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/testEfsVsRegular.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/testEfsVsRegular.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -243,15 +243,14 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
*/
public void testFullPath() throws Exception {
ResourceHelper.createEfsFolder(fProject, "Folder", "null:/Folder");
- ResourceHelper.createEfsFile(fProject, "Folder/testFullPath.c",
- "null:/EfsFolder/efsTestFullPath.c");
+ ResourceHelper.createEfsFile(fProject, "Folder/testFullPath.c", "null:/EfsFolder/efsTestFullPath.c");
parseOutput("EfsFolder/efsTestFullPath.c:1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/Folder/testFullPath.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/Folder/testFullPath.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
@@ -268,8 +267,8 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/NonEfsFolder/testInNonEfsFolder.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/NonEfsFolder/testInNonEfsFolder.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
@@ -279,15 +278,14 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
*/
public void testInFolder() throws Exception {
ResourceHelper.createEfsFolder(fProject, "Folder", "null:/Folder");
- ResourceHelper.createEfsFile(fProject, "Folder/testInFolder.c",
- "null:/EfsFolder/efsTestInFolder.c");
+ ResourceHelper.createEfsFile(fProject, "Folder/testInFolder.c", "null:/EfsFolder/efsTestInFolder.c");
parseOutput("efsTestInFolder.c:1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/Folder/testInFolder.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/Folder/testInFolder.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
@@ -299,17 +297,16 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
ResourceHelper.createEfsFile(fProject, "testDuplicateInRoot.c", "null:/testDuplicateInRoot.c");
ResourceHelper.createEfsFolder(fProject, "Folder", "null:/Folder");
- ResourceHelper.createEfsFile(fProject, "Folder/testDuplicateInRoot.c",
- "null:/Folder/testDuplicateInRoot.c");
+ ResourceHelper.createEfsFile(fProject, "Folder/testDuplicateInRoot.c", "null:/Folder/testDuplicateInRoot.c");
// Resolved to the file in root folder
parseOutput("testDuplicateInRoot.c:1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("L/FindMatchingFilesEfsTest/testDuplicateInRoot.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("L/FindMatchingFilesEfsTest/testDuplicateInRoot.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -325,9 +322,10 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/Folder/testRelativePathFromProjectRoot.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/Folder/testRelativePathFromProjectRoot.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -344,9 +342,10 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/Subfolder/Folder/testRelativePathFromSubfolder.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/Subfolder/Folder/testRelativePathFromSubfolder.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -363,10 +362,10 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match
- assertEquals("P/FindMatchingFilesEfsTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("NotMatchingFolder/testRelativePathNotMatchingFolder.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesEfsTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("NotMatchingFolder/testRelativePathNotMatchingFolder.c"), problemMarkerInfo.externalPath);
}
/**
@@ -388,10 +387,10 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesEfsTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("Folder/testRelativePathDuplicate.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesEfsTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("Folder/testRelativePathDuplicate.c"), problemMarkerInfo.externalPath);
}
/**
@@ -407,9 +406,10 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/Folder/testRelativePathUpSubfolder.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/Folder/testRelativePathUpSubfolder.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -426,9 +426,10 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/Subfolder/Folder/testRelativePathDotFromSubfolder.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/Subfolder/Folder/testRelativePathDotFromSubfolder.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -446,9 +447,9 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesEfsTest/BuildDir/testBuildDir.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesEfsTest/BuildDir/testBuildDir.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -467,8 +468,8 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/EfsProject/Folder/testEfsProject.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/EfsProject/Folder/testEfsProject.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -485,12 +486,12 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
ResourceHelper.createFile(efsProject, "BuildDir/" + fileName);
URI buildDirURI = new URI("mem:/EfsProject/BuildDir/");
- parseOutput(efsProject, buildDirURI, new String[] {mockErrorParserId}, fileName+":1:error");
+ parseOutput(efsProject, buildDirURI, new String[] { mockErrorParserId }, fileName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/EfsProject/BuildDir/"+fileName,problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/EfsProject/BuildDir/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -505,21 +506,19 @@ public class ErrorParserEfsFileMatchingTest extends TestCase {
ResourceHelper.createFolder(efsProject, "Folder");
ResourceHelper.createFolder(efsProject, "Folder/SubFolder");
ResourceHelper.createFile(efsProject, fileName);
- ResourceHelper.createFile(efsProject, "Folder/"+fileName);
- ResourceHelper.createFile(efsProject, "Folder/SubFolder/"+fileName);
+ ResourceHelper.createFile(efsProject, "Folder/" + fileName);
+ ResourceHelper.createFile(efsProject, "Folder/SubFolder/" + fileName);
- String lines = "make[1]: Entering directory `Folder'\n"
- + "make[2]: Entering directory `SubFolder'\n"
- + "make[2]: Leaving directory `SubFolder'\n"
- + fileName+":1:error\n";
+ String lines = "make[1]: Entering directory `Folder'\n" + "make[2]: Entering directory `SubFolder'\n"
+ + "make[2]: Leaving directory `SubFolder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {MAKE_ERRORPARSER_ID, mockErrorParserId };
+ String[] errorParsers = { MAKE_ERRORPARSER_ID, mockErrorParserId };
parseOutput(efsProject, efsProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/EfsProject/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/EfsProject/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java
index 12fc14873d4..246863aa110 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserFileMatchingTest.java
@@ -61,7 +61,8 @@ public class ErrorParserFileMatchingTest extends TestCase {
private final IMarkerGenerator markerGenerator = new IMarkerGenerator() {
// deprecated
@Override
- public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {}
+ public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
+ }
@Override
public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
@@ -78,12 +79,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
*/
public MockErrorParser() {
super(new ErrorPattern[] {
- new ErrorPattern("(.*):(.*):(.*)", 1, 2, 3, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE)
- });
+ new ErrorPattern("(.*):(.*):(.*)", 1, 2, 3, 0, IMarkerGenerator.SEVERITY_ERROR_RESOURCE) });
}
}
-
/**
* Constructor.
* @param name - name of the test.
@@ -95,7 +94,7 @@ public class ErrorParserFileMatchingTest extends TestCase {
@Override
protected void setUp() throws Exception {
- if (fProject==null) {
+ if (fProject == null) {
fProject = ResourceHelper.createCDTProject(testName);
Assert.assertNotNull(fProject);
mockErrorParserId = addErrorParserExtension("MockErrorParser", MockErrorParser.class);
@@ -172,7 +171,7 @@ public class ErrorParserFileMatchingTest extends TestCase {
* Convenience method to parse one line of output.
*/
private void parseOutput(IProject project, String buildDir, String line) throws Exception {
- parseOutput(project, new Path(buildDir), new String[] {mockErrorParserId}, line);
+ parseOutput(project, new Path(buildDir), new String[] { mockErrorParserId }, line);
}
/**
@@ -180,7 +179,7 @@ public class ErrorParserFileMatchingTest extends TestCase {
* Search is done in project location.
*/
private void parseOutput(IProject project, String line) throws Exception {
- parseOutput(project, project.getLocation(), new String[] {mockErrorParserId}, line);
+ parseOutput(project, project.getLocation(), new String[] { mockErrorParserId }, line);
}
/**
@@ -188,7 +187,7 @@ public class ErrorParserFileMatchingTest extends TestCase {
* Search is done for current project in default location.
*/
private void parseOutput(String line) throws Exception {
- parseOutput(fProject, fProject.getLocation(), new String[] {mockErrorParserId}, line);
+ parseOutput(fProject, fProject.getLocation(), new String[] { mockErrorParserId }, line);
}
/**
@@ -202,9 +201,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/testSingle.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/testSingle.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -218,10 +217,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("testMissing.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("testMissing.c"), problemMarkerInfo.externalPath);
}
/**
@@ -240,9 +239,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// Ambiguous match
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("testDuplicate.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("testDuplicate.c"), problemMarkerInfo.externalPath);
}
/**
@@ -257,8 +256,8 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testInFolder.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testInFolder.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -276,9 +275,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("L/FindMatchingFilesTest/testDuplicateInRoot.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("L/FindMatchingFilesTest/testDuplicateInRoot.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -295,8 +294,8 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testLinkedFile.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testLinkedFile.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -313,8 +312,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testLinkedFileWithDifferentName.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testLinkedFileWithDifferentName.c",
+ problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -337,9 +337,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// Ambiguous match
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("testDuplicateLinkedFile.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("testDuplicateLinkedFile.c"), problemMarkerInfo.externalPath);
}
/**
@@ -361,9 +361,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("testDuplicateLinkedFileDifferentName.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("testDuplicateLinkedFileDifferentName.c"), problemMarkerInfo.externalPath);
}
/**
@@ -379,8 +379,8 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/LinkedFolder/testInLinkedFolder.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/LinkedFolder/testInLinkedFolder.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -401,9 +401,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("testDuplicateInLinkedFolder.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("testDuplicateInLinkedFolder.c"), problemMarkerInfo.externalPath);
}
/**
@@ -411,19 +411,20 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testLinkedFolderInAnotherProject() throws Exception {
- ResourceHelper.createFolder(fProject,"Folder");
- ResourceHelper.createFile(fProject,"Folder/testLinkedFolderInAnotherProject.c");
+ ResourceHelper.createFolder(fProject, "Folder");
+ ResourceHelper.createFile(fProject, "Folder/testLinkedFolderInAnotherProject.c");
IProject anotherProject = ResourceHelper.createCDTProject("AnotherProjectWithLinkedFolder");
- ResourceHelper.createLinkedFolder(anotherProject, "LinkedFolder", fProject.getLocation()+"/Folder");
+ ResourceHelper.createLinkedFolder(anotherProject, "LinkedFolder", fProject.getLocation() + "/Folder");
{
parseOutput(fProject, "testLinkedFolderInAnotherProject.c:1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testLinkedFolderInAnotherProject.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testLinkedFolderInAnotherProject.c",
+ problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
{
@@ -431,8 +432,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(2, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(1);
- assertEquals("L/AnotherProjectWithLinkedFolder/LinkedFolder/testLinkedFolderInAnotherProject.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/AnotherProjectWithLinkedFolder/LinkedFolder/testLinkedFolderInAnotherProject.c",
+ problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
}
@@ -448,15 +450,15 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createWorkspaceFolder("OutsideFolder");
IPath realFile = ResourceHelper.createWorkspaceFile("OutsideFolder/RealFile.c");
- ResourceHelper.createFolder(fProject,"Folder");
+ ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createSymbolicLink(fProject, "Folder/testSymbolicLink.c", realFile);
parseOutput("testSymbolicLink.c:1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testSymbolicLink.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testSymbolicLink.c", problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -471,10 +473,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createWorkspaceFolder("OutsideFolder");
IPath realFile = ResourceHelper.createWorkspaceFile("OutsideFolder/RealFile.c");
- ResourceHelper.createFolder(fProject,"FolderA");
+ ResourceHelper.createFolder(fProject, "FolderA");
ResourceHelper.createSymbolicLink(fProject, "FolderA/testDuplicateSymbolicLink.c", realFile);
- ResourceHelper.createFolder(fProject,"FolderB");
+ ResourceHelper.createFolder(fProject, "FolderB");
ResourceHelper.createSymbolicLink(fProject, "FolderB/testDuplicateSymbolicLink.c", realFile);
parseOutput("testDuplicateSymbolicLink.c:1:error");
@@ -482,9 +484,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(new Path("testDuplicateSymbolicLink.c"),problemMarkerInfo.externalPath);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(new Path("testDuplicateSymbolicLink.c"), problemMarkerInfo.externalPath);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -505,8 +507,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/FolderSymbolicLink/testFolderSymbolicLink.c",problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/FolderSymbolicLink/testFolderSymbolicLink.c",
+ problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -529,9 +532,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(new Path("testDuplicateFolderSymbolicLink.c"),problemMarkerInfo.externalPath);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(new Path("testDuplicateFolderSymbolicLink.c"), problemMarkerInfo.externalPath);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -542,13 +545,13 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createFile(fProject, "testAbsolutePathSingle.c");
String fullName = fProject.getLocation().append("testAbsolutePathSingle.c").toOSString();
- parseOutput(fullName+":1:error");
+ parseOutput(fullName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/testAbsolutePathSingle.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/testAbsolutePathSingle.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -560,13 +563,14 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createFile(anotherProject, "testAbsolutePathInOtherProject.c");
String fullName = anotherProject.getLocation().append("testAbsolutePathInOtherProject.c").toOSString();
- parseOutput(fullName+":1:error");
+ parseOutput(fullName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/ProjectAbsolutePathInOtherProject/testAbsolutePathInOtherProject.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/ProjectAbsolutePathInOtherProject/testAbsolutePathInOtherProject.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -579,15 +583,15 @@ public class ErrorParserFileMatchingTest extends TestCase {
IPath outsideFile = ResourceHelper.createWorkspaceFile("OutsideFolder/testAbsolutePathOutsideWorkspace.c");
String fullName = ResourcesPlugin.getWorkspace().getRoot().getLocation()
- .append("OutsideFolder/testAbsolutePathOutsideWorkspace.c").toOSString();
+ .append("OutsideFolder/testAbsolutePathOutsideWorkspace.c").toOSString();
- parseOutput(fullName+":1:error");
+ parseOutput(fullName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// Can't assign marker to non-IResource
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
assertEquals(outsideFile, problemMarkerInfo.externalPath);
}
@@ -603,9 +607,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testRelativePathFromProjectRoot.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testRelativePathFromProjectRoot.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -621,9 +626,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/SubFolder/testRelativePathFromSubfolder.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/SubFolder/testRelativePathFromSubfolder.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -639,10 +645,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("NotMatchingFolder/testRelativePathNotMatchingFolder.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("NotMatchingFolder/testRelativePathNotMatchingFolder.c"), problemMarkerInfo.externalPath);
}
/**
@@ -662,10 +668,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("Folder/testRelativePathDuplicate.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("Folder/testRelativePathDuplicate.c"), problemMarkerInfo.externalPath);
}
/**
@@ -679,9 +685,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/testRelativePathUp.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/testRelativePathUp.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -696,9 +702,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testRelativePathUpSubfolder.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testRelativePathUpSubfolder.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -713,9 +719,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/AnotherProject/testRelativePathUpOtherProject.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/AnotherProject/testRelativePathUpOtherProject.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -733,10 +739,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("../SubFolder/testRelativePathUpDuplicate.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("../SubFolder/testRelativePathUpDuplicate.c"), problemMarkerInfo.externalPath);
}
/**
@@ -751,9 +757,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testRelativePathDotFromProjectRoot.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testRelativePathDotFromProjectRoot.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -769,9 +776,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Subfolder/Folder/testRelativePathDotFromSubfolder.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Subfolder/Folder/testRelativePathDotFromSubfolder.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -787,10 +795,11 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("./NotMatchingFolder/testRelativePathDotNotMatchingFolder.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("./NotMatchingFolder/testRelativePathDotNotMatchingFolder.c"),
+ problemMarkerInfo.externalPath);
}
/**
@@ -811,13 +820,12 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("./Folder/testRelativePathDotDuplicate.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("./Folder/testRelativePathDotDuplicate.c"), problemMarkerInfo.externalPath);
}
-
/**
* Checks if a file from error output can be found.
* @throws Exception...
@@ -834,9 +842,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/upcase1.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/upcase1.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -852,9 +860,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/UPCASE2.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/UPCASE2.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -872,9 +880,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/FolderB/UpCase3.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/FolderB/UpCase3.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -893,10 +901,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
// No match found
- assertEquals("P/FindMatchingFilesTest",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
- assertEquals(new Path("UpCase4.c"),problemMarkerInfo.externalPath);
+ assertEquals("P/FindMatchingFilesTest", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
+ assertEquals(new Path("UpCase4.c"), problemMarkerInfo.externalPath);
}
/**
@@ -913,17 +921,17 @@ public class ErrorParserFileMatchingTest extends TestCase {
// Skip the test if Cygwin is not available.
return;
}
- assertTrue("cygwinFileName=["+cygwinFileName+"]", cygwinFileName.startsWith("/cygdrive/"));
+ assertTrue("cygwinFileName=[" + cygwinFileName + "]", cygwinFileName.startsWith("/cygdrive/"));
ResourceHelper.createFile(fProject, fileName);
- parseOutput(cygwinFileName+":1:error");
+ parseOutput(cygwinFileName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -942,21 +950,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
return;
}
- assertTrue("usrIncludeWindowsPath=["+usrIncludeWindowsPath+"]",
- usrIncludeWindowsPath.charAt(1)==IPath.DEVICE_SEPARATOR);
+ assertTrue("usrIncludeWindowsPath=[" + usrIncludeWindowsPath + "]",
+ usrIncludeWindowsPath.charAt(1) == IPath.DEVICE_SEPARATOR);
java.io.File file = new java.io.File(usrIncludeWindowsPath + "\\" + fileName);
assertTrue("File " + file + " does not exist, check your cygwin installation", file.exists());
ResourceHelper.createLinkedFolder(fProject, "include", usrIncludeWindowsPath);
- parseOutput(cygwinFolder+fileName+":1:error");
+ parseOutput(cygwinFolder + fileName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/include/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/include/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -975,17 +983,17 @@ public class ErrorParserFileMatchingTest extends TestCase {
// Skip the test if Cygwin is not available.
return;
}
- assertTrue("cygwinFileName=["+cygwinFileName+"]", cygwinFileName.startsWith("/cygdrive/"));
+ assertTrue("cygwinFileName=[" + cygwinFileName + "]", cygwinFileName.startsWith("/cygdrive/"));
ResourceHelper.createFile(anotherProject, fileName);
- parseOutput(cygwinFileName+":1:error");
+ parseOutput(cygwinFileName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/AnotherProject/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/AnotherProject/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -995,7 +1003,7 @@ public class ErrorParserFileMatchingTest extends TestCase {
public void testCustomProjectLocation() throws Exception {
ResourceHelper.createWorkspaceFolder("Custom");
ResourceHelper.createWorkspaceFolder("Custom/ProjectLocation");
- IProject anotherProject = ResourceHelper.createCDTProject("AnotherProject", "Custom/ProjectLocation");
+ IProject anotherProject = ResourceHelper.createCDTProject("AnotherProject", "Custom/ProjectLocation");
ResourceHelper.createFolder(anotherProject, "Folder");
ResourceHelper.createFile(anotherProject, "Folder/testCustomProjectLocation.c");
@@ -1004,9 +1012,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/AnotherProject/Folder/testCustomProjectLocation.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/AnotherProject/Folder/testCustomProjectLocation.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1024,21 +1032,20 @@ public class ErrorParserFileMatchingTest extends TestCase {
// Skip the test if Cygwin is not available.
return;
}
- assertTrue("cygwinFileName=["+cygwinFileName+"]", cygwinFileName.startsWith("/cygdrive/"));
+ assertTrue("cygwinFileName=[" + cygwinFileName + "]", cygwinFileName.startsWith("/cygdrive/"));
ResourceHelper.createFile(fProject, fileName);
- String lines = "make[0]: Entering directory `dir'\n"
- + cygwinFileName+":1:error\n";
+ String lines = "make[0]: Entering directory `dir'\n" + cygwinFileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1047,7 +1054,8 @@ public class ErrorParserFileMatchingTest extends TestCase {
*/
public void testInNestedProject() throws Exception {
ResourceHelper.createFolder(fProject, "NestedProjectFolder");
- IProject nestedProject = ResourceHelper.createCDTProject("NestedProject", "FindMatchingFilesTest/NestedProject");
+ IProject nestedProject = ResourceHelper.createCDTProject("NestedProject",
+ "FindMatchingFilesTest/NestedProject");
ResourceHelper.createFolder(nestedProject, "Folder");
ResourceHelper.createFile(nestedProject, "Folder/testInNestedProject.c");
@@ -1057,9 +1065,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/NestedProject/Folder/testInNestedProject.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/NestedProject/Folder/testInNestedProject.c",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
{
@@ -1067,9 +1076,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(2, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(1);
- assertEquals("L/NestedProject/Folder/testInNestedProject.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/NestedProject/Folder/testInNestedProject.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
}
@@ -1088,9 +1097,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/BuildDir/testBuildDir.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/BuildDir/testBuildDir.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1107,9 +1116,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/BuildDir/testBuildDirVsProjectRoot.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/BuildDir/testBuildDirVsProjectRoot.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1123,13 +1132,13 @@ public class ErrorParserFileMatchingTest extends TestCase {
String fullName = file.getLocation().toOSString();
ResourceHelper.createLinkedFile(fProject, "testAbsoluteFileVsLink.c", file.getLocation());
- parseOutput(fullName+":1:error");
+ parseOutput(fullName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/testAbsoluteFileVsLink.c",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/testAbsoluteFileVsLink.c", problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1141,19 +1150,18 @@ public class ErrorParserFileMatchingTest extends TestCase {
String fileName = "testPushDirectory.c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1166,19 +1174,18 @@ public class ErrorParserFileMatchingTest extends TestCase {
String fileName = "testPushDirectory.c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make[0]: Entering directory 'Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make[0]: Entering directory 'Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1190,22 +1197,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
String fileName = "testPushAbsoluteDirectory.c";
IFolder folder = ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
IPath absoluteDir = folder.getLocation();
Assert.assertTrue(absoluteDir.isAbsolute());
- String lines = "make[0]: Entering directory `" + absoluteDir + "'\n"
- + fileName+":1:error\n";
+ String lines = "make[0]: Entering directory `" + absoluteDir + "'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1220,22 +1226,20 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createFolder(fProject, "Folder/SubFolder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
- ResourceHelper.createFile(fProject, "Folder/SubFolder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
+ ResourceHelper.createFile(fProject, "Folder/SubFolder/" + fileName);
- String lines = "make[1]: Entering directory `Folder'\n"
- + "make[2]: Entering directory `SubFolder'\n"
- + "make[2]: Leaving directory `SubFolder'\n"
- + fileName+":1:error\n";
+ String lines = "make[1]: Entering directory `Folder'\n" + "make[2]: Entering directory `SubFolder'\n"
+ + "make[2]: Leaving directory `SubFolder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1250,22 +1254,20 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createFolder(fProject, "Folder/SubFolder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
- ResourceHelper.createFile(fProject, "Folder/SubFolder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
+ ResourceHelper.createFile(fProject, "Folder/SubFolder/" + fileName);
- String lines = "make: Entering directory `Folder'\n"
- + "make: Entering directory `SubFolder'\n"
- + "make: Leaving directory `SubFolder'\n"
- + fileName+":1:error\n";
+ String lines = "make: Entering directory `Folder'\n" + "make: Entering directory `SubFolder'\n"
+ + "make: Leaving directory `SubFolder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1277,28 +1279,26 @@ public class ErrorParserFileMatchingTest extends TestCase {
String fileName = "testPushDirectoryCacheProblem.c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = fileName+":1:error\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = fileName + ":1:error\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(2, errorList.size());
{
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
{
ProblemMarkerInfo problemMarkerInfo = errorList.get(1);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
}
@@ -1308,23 +1308,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_J() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make -j\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make -j\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1333,23 +1331,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_J2() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make -j2\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make -j2\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1358,23 +1354,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_J_2() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make -j 2\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make -j 2\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1383,23 +1377,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_J1() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make -j1\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make -j1\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1408,23 +1400,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_J_1() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make -j 1\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make -j 1\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1433,23 +1423,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_Jobs() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make --jobs=2\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make --jobs=2\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1458,23 +1446,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_Jobs1() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "make --jobs=1\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "make --jobs=1\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1483,23 +1469,21 @@ public class ErrorParserFileMatchingTest extends TestCase {
* @throws Exception...
*/
public void testDisablePushDirectoryOnParallelBuild_gmake() throws Exception {
- String fileName = getName()+".c";
+ String fileName = getName() + ".c";
ResourceHelper.createFolder(fProject, "Folder");
ResourceHelper.createFile(fProject, fileName);
- ResourceHelper.createFile(fProject, "Folder/"+fileName);
+ ResourceHelper.createFile(fProject, "Folder/" + fileName);
- String lines = "gmake384 -k -j all\n"
- + "make[0]: Entering directory `Folder'\n"
- + fileName+":1:error\n";
+ String lines = "gmake384 -k -j all\n" + "make[0]: Entering directory `Folder'\n" + fileName + ":1:error\n";
- String[] errorParsers = {CWD_LOCATOR_ID, mockErrorParserId };
+ String[] errorParsers = { CWD_LOCATOR_ID, mockErrorParserId };
parseOutput(fProject, fProject.getLocation(), errorParsers, lines);
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/"+fileName,problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1516,9 +1500,10 @@ public class ErrorParserFileMatchingTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/Folder/AbsoluteRemoteFolder/testMappedRemoteAbsolutePath.h",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/Folder/AbsoluteRemoteFolder/testMappedRemoteAbsolutePath.h",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1532,15 +1517,18 @@ public class ErrorParserFileMatchingTest extends TestCase {
ResourceHelper.createFolder(anotherProject, "Folder");
ResourceHelper.createFolder(anotherProject, "Folder/AbsoluteRemoteFolder");
- IFile file = ResourceHelper.createFile(anotherProject, "Folder/AbsoluteRemoteFolder/testMappedRemoteAbsolutePathAnotherProject.h");
+ IFile file = ResourceHelper.createFile(anotherProject,
+ "Folder/AbsoluteRemoteFolder/testMappedRemoteAbsolutePathAnotherProject.h");
parseOutput("/AbsoluteRemoteFolder/testMappedRemoteAbsolutePathAnotherProject.h:1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/ProjectMappedRemoteAbsolutePathAnotherProject/Folder/AbsoluteRemoteFolder/testMappedRemoteAbsolutePathAnotherProject.h",problemMarkerInfo.file.toString());
- assertEquals(1,problemMarkerInfo.lineNumber);
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals(
+ "L/ProjectMappedRemoteAbsolutePathAnotherProject/Folder/AbsoluteRemoteFolder/testMappedRemoteAbsolutePathAnotherProject.h",
+ problemMarkerInfo.file.toString());
+ assertEquals(1, problemMarkerInfo.lineNumber);
+ assertEquals("error", problemMarkerInfo.description);
}
/**
@@ -1550,12 +1538,9 @@ public class ErrorParserFileMatchingTest extends TestCase {
*/
public void testWindowsPathOnLinux_Bug263977() throws Exception {
// This test is valid on Unix platforms only
- boolean isUnix = Platform.getOS().equals(Platform.OS_LINUX)
- || Platform.getOS().equals(Platform.OS_AIX)
- || Platform.getOS().equals(Platform.OS_SOLARIS)
- || Platform.getOS().equals(Platform.OS_HPUX)
- || Platform.getOS().equals(Platform.OS_QNX)
- || Platform.getOS().equals(Platform.OS_MACOSX);
+ boolean isUnix = Platform.getOS().equals(Platform.OS_LINUX) || Platform.getOS().equals(Platform.OS_AIX)
+ || Platform.getOS().equals(Platform.OS_SOLARIS) || Platform.getOS().equals(Platform.OS_HPUX)
+ || Platform.getOS().equals(Platform.OS_QNX) || Platform.getOS().equals(Platform.OS_MACOSX);
if (!isUnix) {
return;
}
@@ -1563,15 +1548,15 @@ public class ErrorParserFileMatchingTest extends TestCase {
String fileName = "testWindowsPathOnLinux_Bug263977.c";
ResourceHelper.createFolder(fProject, "w:/Folder/Subfolder");
- ResourceHelper.createFile(fProject, "w:/Folder/Subfolder/"+fileName);
+ ResourceHelper.createFile(fProject, "w:/Folder/Subfolder/" + fileName);
// Note that main intention of this test is to run on *Linux*, see bug 263977
- parseOutput("W:\\Folder\\Subfolder\\"+fileName+":1:error");
+ parseOutput("W:\\Folder\\Subfolder\\" + fileName + ":1:error");
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("L/FindMatchingFilesTest/w:/Folder/Subfolder/"+fileName,problemMarkerInfo.file.toString());
- assertEquals("error",problemMarkerInfo.description);
+ assertEquals("L/FindMatchingFilesTest/w:/Folder/Subfolder/" + fileName, problemMarkerInfo.file.toString());
+ assertEquals("error", problemMarkerInfo.description);
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java
index a66d1637c61..e9cc8dc7133 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserManagerTest.java
@@ -49,7 +49,7 @@ import junit.framework.TestSuite;
/**
* @author Alena Laskavaia
*
- * Tests for ErrorParser manager and different parsers
+ * Tests for ErrorParser manager and different parsers
*/
public class ErrorParserManagerTest extends TestCase {
IWorkspace workspace;
@@ -73,15 +73,15 @@ public class ErrorParserManagerTest extends TestCase {
* Sets up the test fixture.
*
* Called before every test case method.
- *
- * Example code test the packages in the project
+ *
+ * Example code test the packages in the project
* "com.qnx.tools.ide.cdt.core"
*/
@Override
protected void setUp() throws Exception {
/***
* The test of the tests assume that they have a working workspace
- * and workspace root object to use to create projects/files in,
+ * and workspace root object to use to create projects/files in,
* so we need to get them setup first.
*/
IWorkspaceDescription desc;
@@ -109,14 +109,9 @@ public class ErrorParserManagerTest extends TestCase {
errorList.add(problemMarkerInfo);
}
};
- String[] errorParsersIds = {
- "org.eclipse.cdt.core.CWDLocator",
- "org.eclipse.cdt.core.GCCErrorParser",
- "org.eclipse.cdt.core.GASErrorParser",
- "org.eclipse.cdt.core.GLDErrorParser",
- "org.eclipse.cdt.core.VCErrorParser",
- "org.eclipse.cdt.core.GmakeErrorParser",
- };
+ String[] errorParsersIds = { "org.eclipse.cdt.core.CWDLocator", "org.eclipse.cdt.core.GCCErrorParser",
+ "org.eclipse.cdt.core.GASErrorParser", "org.eclipse.cdt.core.GLDErrorParser",
+ "org.eclipse.cdt.core.VCErrorParser", "org.eclipse.cdt.core.GmakeErrorParser", };
epManager = new ErrorParserManager(cProject.getProject(), markerGenerator, errorParsersIds);
}
@@ -161,25 +156,25 @@ public class ErrorParserManagerTest extends TestCase {
output("catchpoints.cpp:12: warning: no return statement in function returning non-void\n");
end();
assertEquals(1, errorList.size());
-
+
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("no return statement in function returning non-void",problemMarkerInfo.description);
- assertEquals(new Path("catchpoints.cpp"),problemMarkerInfo.externalPath);
+ assertEquals("no return statement in function returning non-void", problemMarkerInfo.description);
+ assertEquals(new Path("catchpoints.cpp"), problemMarkerInfo.externalPath);
}
public void testParsersSanityTrimmed() throws CoreException, IOException {
output(" catchpoints.cpp:12: warning: no return statement in function returning non-void \n");
end();
assertEquals(1, errorList.size());
-
+
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("no return statement in function returning non-void",problemMarkerInfo.description);
- assertEquals(new Path("catchpoints.cpp"),problemMarkerInfo.externalPath);
+ assertEquals("no return statement in function returning non-void", problemMarkerInfo.description);
+ assertEquals(new Path("catchpoints.cpp"), problemMarkerInfo.externalPath);
}
public void testOutput() throws IOException {
- try (FileInputStream fileInputStream = new FileInputStream(CTestPlugin.getDefault().getFileInPlugin(
- new Path("resources/errortests/output-1")))) {
+ try (FileInputStream fileInputStream = new FileInputStream(
+ CTestPlugin.getDefault().getFileInPlugin(new Path("resources/errortests/output-1")))) {
byte b[] = new byte[1024];
while (true) {
int k = fileInputStream.read(b);
@@ -209,6 +204,7 @@ public class ErrorParserManagerTest extends TestCase {
public static class TestParser1 implements IErrorParser2 {
String last = null;
+
@Override
public int getProcessLineBehaviour() {
return KEEP_UNTRIMMED;
@@ -216,8 +212,8 @@ public class ErrorParserManagerTest extends TestCase {
@Override
public boolean processLine(String line, ErrorParserManager eoParser) {
- if (line.startsWith(" ") && last!=null) {
- eoParser.generateExternalMarker(null, 1, last+line, 1, "", null);
+ if (line.startsWith(" ") && last != null) {
+ eoParser.generateExternalMarker(null, 1, last + line, 1, "", null);
return true;
}
if (line.startsWith("bug:")) {
@@ -230,18 +226,19 @@ public class ErrorParserManagerTest extends TestCase {
return false;
}
}
+
public void testNoTrimParser() throws IOException {
String id = addErrorParserExtension("test1", TestParser1.class);
epManager = new ErrorParserManager(cProject.getProject(), markerGenerator, new String[] { id });
-
+
output("bug: start\n");
output(" end");
end();
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
- assertEquals("bug: start end",problemMarkerInfo.description);
+ assertEquals("bug: start end", problemMarkerInfo.description);
}
-
+
public static class TestParser2 implements IErrorParser2 {
@Override
public int getProcessLineBehaviour() {
@@ -262,7 +259,7 @@ public class ErrorParserManagerTest extends TestCase {
public void testLongLinesParser() throws IOException {
String id = addErrorParserExtension("test2", TestParser2.class);
epManager = new ErrorParserManager(cProject.getProject(), markerGenerator, new String[] { id });
-
+
StringBuilder buf = new StringBuilder("errorT: ");
for (int i = 0; i < 100; i++) {
buf.append("la la la la la ").append(i).append(' ');
@@ -273,10 +270,10 @@ public class ErrorParserManagerTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
int l = problemMarkerInfo.description.length();
- assertTrue(l>1000);
- String end = problemMarkerInfo.description.substring(l-10,l);
+ assertTrue(l > 1000);
+ String end = problemMarkerInfo.description.substring(l - 10, l);
// check - line trimmed but long
- assertEquals("a la la 99",end);
+ assertEquals("a la la 99", end);
}
public static class TestParser3 implements IErrorParser2 {
@@ -299,7 +296,7 @@ public class ErrorParserManagerTest extends TestCase {
public void testLongLinesUntrimmedParser() throws IOException {
String id = addErrorParserExtension("test3", TestParser3.class);
epManager = new ErrorParserManager(cProject.getProject(), markerGenerator, new String[] { id });
-
+
StringBuilder buf = new StringBuilder("errorT: ");
for (int i = 0; i < 100; i++) {
buf.append("la la la la la ").append(i).append(' ');
@@ -310,17 +307,17 @@ public class ErrorParserManagerTest extends TestCase {
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
int l = problemMarkerInfo.description.length();
- assertTrue(l>1000);
- String end = problemMarkerInfo.description.substring(l-10,l);
+ assertTrue(l > 1000);
+ String end = problemMarkerInfo.description.substring(l - 10, l);
// check - line trimmed but long
- assertEquals(" la la 99 ",end);
+ assertEquals(" la la 99 ", end);
}
public static class TestParser4 implements IErrorParser {
@Override
public boolean processLine(String line, ErrorParserManager eoParser) {
- ProblemMarkerInfo problemMarkerInfo =
- new ProblemMarkerInfo(null, 0, "Workspace level marker", IMarker.SEVERITY_INFO, null);
+ ProblemMarkerInfo problemMarkerInfo = new ProblemMarkerInfo(null, 0, "Workspace level marker",
+ IMarker.SEVERITY_INFO, null);
eoParser.addProblemMarker(problemMarkerInfo);
return true;
}
@@ -329,9 +326,9 @@ public class ErrorParserManagerTest extends TestCase {
public void testWorkspaceLevelError() throws IOException {
String id = addErrorParserExtension("test4", TestParser4.class);
epManager = new ErrorParserManager(null, markerGenerator, new String[] { id });
-
+
StringBuilder buf = new StringBuilder("errorT: ");
- output(buf.toString()+"\n");
+ output(buf.toString() + "\n");
end();
assertEquals(1, errorList.size());
ProblemMarkerInfo problemMarkerInfo = errorList.get(0);
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserTests.java
index cb8eba9d722..b2c9e0762dc 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/ErrorParserTests.java
@@ -16,23 +16,22 @@ package org.eclipse.cdt.core.internal.errorparsers.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
-
public class ErrorParserTests {
public static Test suite() {
- TestSuite suite = new TestSuite(ErrorParserTests.class.getName());
+ TestSuite suite = new TestSuite(ErrorParserTests.class.getName());
- // Just add more test cases here as you create them for
- // each class being tested
- suite.addTest(GCCErrorParserTests.suite());
- suite.addTest(GLDErrorParserTests.suite());
- suite.addTest(MakeErrorParserTests.suite());
- suite.addTest(FileBasedErrorParserTests.suite());
- suite.addTest(ErrorParserManagerTest.suite());
- suite.addTest(ErrorParserFileMatchingTest.suite());
- suite.addTest(ErrorParserEfsFileMatchingTest.suite());
- suite.addTest(RegexErrorParserTests.suite());
- return suite;
+ // Just add more test cases here as you create them for
+ // each class being tested
+ suite.addTest(GCCErrorParserTests.suite());
+ suite.addTest(GLDErrorParserTests.suite());
+ suite.addTest(MakeErrorParserTests.suite());
+ suite.addTest(FileBasedErrorParserTests.suite());
+ suite.addTest(ErrorParserManagerTest.suite());
+ suite.addTest(ErrorParserFileMatchingTest.suite());
+ suite.addTest(ErrorParserEfsFileMatchingTest.suite());
+ suite.addTest(RegexErrorParserTests.suite());
+ return suite;
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/FileBasedErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/FileBasedErrorParserTests.java
index 903de35238b..4d26b3c947d 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/FileBasedErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/FileBasedErrorParserTests.java
@@ -32,7 +32,7 @@ public class FileBasedErrorParserTests extends GenericErrorParserTests {
super("testErrorsInFiles");
errorFile = file;
}
-
+
@Override
public String getName() {
return super.getName() + " " + errorFile.getName();
@@ -41,7 +41,7 @@ public class FileBasedErrorParserTests extends GenericErrorParserTests {
public void testErrorsInFiles() throws IOException {
InputStream stream = new FileInputStream(errorFile);
- runParserTest(stream, -1, -1, null, null, new String[]{GCC_ERROR_PARSER_ID});
+ runParserTest(stream, -1, -1, null, null, new String[] { GCC_ERROR_PARSER_ID });
stream.close();
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java
index d20298423f5..1514d2fde78 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java
@@ -14,13 +14,11 @@
*******************************************************************************/
package org.eclipse.cdt.core.internal.errorparsers.tests;
-
import java.io.IOException;
import junit.framework.Test;
import junit.framework.TestSuite;
-
/**
* This test is designed to exercise the error parser capabilities.
*/
@@ -29,29 +27,30 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
public static final String[] GCC_ERROR_STREAM1 = {
"qcc -c -I/qnx630/target/qnx6/usr/include -I/qnx630/target/qnx6/usr/include/photon -V3.3.1,gcc_ntox86 -w5 -O2 -I. ../abmain.c abmain.o",
"In file included from ../globals.h:9,", " from ../abmain.c:36:",
- "../_combolist.h:34:24: warning: no newline at end of file",};
+ "../_combolist.h:34:24: warning: no newline at end of file", };
public static final int GCC_ERROR_STREAM1_WARNINGS = 1;
public static final int GCC_ERROR_STREAM1_ERRORS = 0;
- public static final String[] GCC_ERROR_STREAM1_FILENAMES = {"_combolist.h"};
+ public static final String[] GCC_ERROR_STREAM1_FILENAMES = { "_combolist.h" };
- public static final String[] GCC_ERROR_STREAM2 = {"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: `",
+ public static final String[] GCC_ERROR_STREAM2 = {
+ "C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: `",
" RPNEvaluator<NumericType>::OperandConstant' is implicitly a typename",
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:234: warning: implicit typename",
- " is deprecated, please see the documentation for details"};
+ " is deprecated, please see the documentation for details" };
public static final int GCC_ERROR_STREAM2_WARNINGS = 2;
public static final int GCC_ERROR_STREAM2_ERRORS = 0;
- public static final String[] GCC_ERROR_STREAM2_FILENAMES = {"RPNEvaluator.hpp"};
- public static final String[] GCC_ERROR_STREAM2_DESCRIPTIONS = {"please see the documentation"};
+ public static final String[] GCC_ERROR_STREAM2_FILENAMES = { "RPNEvaluator.hpp" };
+ public static final String[] GCC_ERROR_STREAM2_DESCRIPTIONS = { "please see the documentation" };
public static final String[] GCC_ERROR_STREAM3 = {
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:370: error: ISO C++ says that `",
" char& String::operator[](unsigned int)' and `operator[]' are ambiguous even ",
- " though the worst conversion for the former is better than the worst ", " conversion for the latter"};
+ " though the worst conversion for the former is better than the worst ", " conversion for the latter" };
public static final int GCC_ERROR_STREAM3_WARNINGS = 0;
public static final int GCC_ERROR_STREAM3_ERRORS = 1;
- public static final String[] GCC_ERROR_STREAM3_FILENAMES = {"RPNEvaluator.hpp"};
- public static final String[] GCC_ERROR_STREAM3_DESCRIPTIONS = {"ISO C++", "are ambiguous", "worst conversion",
- "conversion for the latter"};
+ public static final String[] GCC_ERROR_STREAM3_FILENAMES = { "RPNEvaluator.hpp" };
+ public static final String[] GCC_ERROR_STREAM3_DESCRIPTIONS = { "ISO C++", "are ambiguous", "worst conversion",
+ "conversion for the latter" };
public static final String[] GCC_ERROR_STREAM4 = {
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp: In member function `",
@@ -60,37 +59,26 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
"C:/QNX630/workspace/System/inc/RPNEvaluator.hpp:370: error: ISO C++ says that `",
" char& String::operator[](unsigned int)' and `operator[]' are ambiguous even ",
" though the worst conversion for the former is better than the worst ",
- " conversion for the latter",
- };
+ " conversion for the latter", };
public static final int GCC_ERROR_STREAM4_WARNINGS = 0;
public static final int GCC_ERROR_STREAM4_ERRORS = 1;
- public static final String[] GCC_ERROR_STREAM4_FILENAMES = {"RPNEvaluator.hpp"};
- public static final String[] GCC_ERROR_STREAM4_DESCRIPTIONS = {
- "ISO C++",
- "are ambiguous",
- "worst conversion for",
- "conversion for the latter"
- };
+ public static final String[] GCC_ERROR_STREAM4_FILENAMES = { "RPNEvaluator.hpp" };
+ public static final String[] GCC_ERROR_STREAM4_DESCRIPTIONS = { "ISO C++", "are ambiguous", "worst conversion for",
+ "conversion for the latter" };
- public static final String[] GCC_ERROR_STREAM5 = {
- "make -k all",
- "gcc -c -g -o hallo.o main.c",
- "main.c: In function `main':",
- "main.c:6: error: `wrong' undeclared (first use in this function)",
+ public static final String[] GCC_ERROR_STREAM5 = { "make -k all", "gcc -c -g -o hallo.o main.c",
+ "main.c: In function `main':", "main.c:6: error: `wrong' undeclared (first use in this function)",
"main.c:6: error: (Each undeclared identifier is reported only once",
- "main.c:6: error: for each function it appears in.)",
- "main.c:6: error: parse error before \"return\"",
- "main.c:7:2: warning: no newline at end of file",
- "make: *** [hallo.o] Error 1",
- "make: Target `all' not remade because of errors."
- };
+ "main.c:6: error: for each function it appears in.)", "main.c:6: error: parse error before \"return\"",
+ "main.c:7:2: warning: no newline at end of file", "make: *** [hallo.o] Error 1",
+ "make: Target `all' not remade because of errors." };
public static final int GCC_ERROR_STREAM5_WARNINGS = 1;
public static final int GCC_ERROR_STREAM5_ERRORS = 2;
- public static final String[] GCC_ERROR_STREAM5_FILENAMES = {"main.c"};
+ public static final String[] GCC_ERROR_STREAM5_FILENAMES = { "main.c" };
/**
* Constructor for IndexManagerTest.
- *
+ *
* @param name
*/
public GCCErrorParserTests() {
@@ -103,156 +91,119 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
}
public void testMultipleIncludesError() throws IOException {
- runParserTest(GCC_ERROR_STREAM1, GCC_ERROR_STREAM1_ERRORS, GCC_ERROR_STREAM1_WARNINGS, GCC_ERROR_STREAM1_FILENAMES, null,
- new String[]{GCC_ERROR_PARSER_ID});
+ runParserTest(GCC_ERROR_STREAM1, GCC_ERROR_STREAM1_ERRORS, GCC_ERROR_STREAM1_WARNINGS,
+ GCC_ERROR_STREAM1_FILENAMES, null, new String[] { GCC_ERROR_PARSER_ID });
}
-/*
- * Norbert Ploett
- * I am commenting these tests out. The current error parser implementation
- * invariably fails to correctly process the descriptions in multiline messages.
- * My analysis indicates that these tests never were really in the automatic tests anyway.
- * This test appears in org.eclipse.cdt.core.suite.AutomatedIntegrationSuite.suite() since it's version 1.31
- * but was always commented out.
- * I brought this up in http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg08668.html
- * but did not get any replies.
- *
- public void testMultiLineDescriptionError() throws IOException {
- runParserTest(GCC_ERROR_STREAM2, GCC_ERROR_STREAM2_ERRORS, GCC_ERROR_STREAM2_WARNINGS, GCC_ERROR_STREAM2_FILENAMES,
- GCC_ERROR_STREAM2_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
- }
+ /*
+ * Norbert Ploett
+ * I am commenting these tests out. The current error parser implementation
+ * invariably fails to correctly process the descriptions in multiline messages.
+ * My analysis indicates that these tests never were really in the automatic tests anyway.
+ * This test appears in org.eclipse.cdt.core.suite.AutomatedIntegrationSuite.suite() since it's version 1.31
+ * but was always commented out.
+ * I brought this up in http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg08668.html
+ * but did not get any replies.
+ *
+ public void testMultiLineDescriptionError() throws IOException {
+ runParserTest(GCC_ERROR_STREAM2, GCC_ERROR_STREAM2_ERRORS, GCC_ERROR_STREAM2_WARNINGS, GCC_ERROR_STREAM2_FILENAMES,
+ GCC_ERROR_STREAM2_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
+ }
+
+ public void testLongMultiLineDescriptionError() throws IOException {
+ runParserTest(GCC_ERROR_STREAM3, GCC_ERROR_STREAM3_ERRORS, GCC_ERROR_STREAM3_WARNINGS, GCC_ERROR_STREAM3_FILENAMES,
+ GCC_ERROR_STREAM3_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
+ }
+
+ public void testMultiFileMultiLineSingleError() throws IOException {
+ runParserTest(GCC_ERROR_STREAM4, GCC_ERROR_STREAM4_ERRORS, GCC_ERROR_STREAM4_WARNINGS, GCC_ERROR_STREAM4_FILENAMES,
+ GCC_ERROR_STREAM4_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
+ }
+ */
- public void testLongMultiLineDescriptionError() throws IOException {
- runParserTest(GCC_ERROR_STREAM3, GCC_ERROR_STREAM3_ERRORS, GCC_ERROR_STREAM3_WARNINGS, GCC_ERROR_STREAM3_FILENAMES,
- GCC_ERROR_STREAM3_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
- }
-
- public void testMultiFileMultiLineSingleError() throws IOException {
- runParserTest(GCC_ERROR_STREAM4, GCC_ERROR_STREAM4_ERRORS, GCC_ERROR_STREAM4_WARNINGS, GCC_ERROR_STREAM4_FILENAMES,
- GCC_ERROR_STREAM4_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
- }
-*/
-
public void testBasicMessages() throws IOException {
- runParserTest(GCC_ERROR_STREAM5, GCC_ERROR_STREAM5_ERRORS, GCC_ERROR_STREAM5_WARNINGS, GCC_ERROR_STREAM5_FILENAMES,
- null, new String[]{GCC_ERROR_PARSER_ID});
+ runParserTest(GCC_ERROR_STREAM5, GCC_ERROR_STREAM5_ERRORS, GCC_ERROR_STREAM5_WARNINGS,
+ GCC_ERROR_STREAM5_FILENAMES, null, new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_Colon_bug263987() throws IOException {
- runParserTest(
- new String[] {"foo.cc:11:20: error: value with length 0 violates the length restriction: length (1 .. infinity)",},
+ runParserTest(new String[] {
+ "foo.cc:11:20: error: value with length 0 violates the length restriction: length (1 .. infinity)", },
1, // errors
0, // warnings
- new String[] {"foo.cc"},
- new String[] {"value with length 0 violates the length restriction: length (1 .. infinity)"},
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ new String[] { "foo.cc" },
+ new String[] { "value with length 0 violates the length restriction: length (1 .. infinity)" },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_C90Comments_bug193982() throws IOException {
runParserTest(
- new String[] {
- "Myfile.c:66:3: warning: C++ style comments are not allowed in ISO C90",
- "Myfile.c:66:3: warning: (this will be reported only once per input file)",
- },
+ new String[] { "Myfile.c:66:3: warning: C++ style comments are not allowed in ISO C90",
+ "Myfile.c:66:3: warning: (this will be reported only once per input file)", },
0, // errors
1, // warnings
- new String[] {"Myfile.c"},
- new String[] {"C++ style comments are not allowed in ISO C90"},
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ new String[] { "Myfile.c" }, new String[] { "C++ style comments are not allowed in ISO C90" },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_ConflictingTypes() throws IOException {
runParserTest(
- new String[] {
- "bar.h:42: error: conflicting types for 'jmp_buf'",
- "foo.c:12: warning: conflicting types for built-in function `memset'",
- },
+ new String[] { "bar.h:42: error: conflicting types for 'jmp_buf'",
+ "foo.c:12: warning: conflicting types for built-in function `memset'", },
1, // errors
1, // warnings
- new String[] {"bar.h", "foo.c"},
- new String[] {
- "conflicting types for 'jmp_buf'",
- "conflicting types for built-in function `memset'",
- },
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ new String[] { "bar.h", "foo.c" },
+ new String[] { "conflicting types for 'jmp_buf'", "conflicting types for built-in function `memset'", },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_InstantiatedFromHere() throws IOException {
- runParserTest(
- new String[] {
- "/usr/include/c++/4.1.3/ext/hashtable.h:600: instantiated from 'size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num(const _Val&, size_t) const [with _Val = std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, _Key = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _HashFcn = __gnu_cxx::hash<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _ExtractKey = std::_Select1st<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> >, _EqualKey = std::equal_to<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _Alloc = std::allocator<int>]'",
- "C:/QNX630/workspace/System/src/NewCommonScriptClasses.cpp:609: instantiated from here",
- },
- 0, // errors
+ runParserTest(new String[] {
+ "/usr/include/c++/4.1.3/ext/hashtable.h:600: instantiated from 'size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num(const _Val&, size_t) const [with _Val = std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, _Key = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _HashFcn = __gnu_cxx::hash<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _ExtractKey = std::_Select1st<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> >, _EqualKey = std::equal_to<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _Alloc = std::allocator<int>]'",
+ "C:/QNX630/workspace/System/src/NewCommonScriptClasses.cpp:609: instantiated from here", }, 0, // errors
0, // warnings
2, // infos
- new String[] {
- "hashtable.h",
- "NewCommonScriptClasses.cpp",
- },
+ new String[] { "hashtable.h", "NewCommonScriptClasses.cpp", },
new String[] {
"instantiated from 'size_t __gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc>::_M_bkt_num(const _Val&, size_t) const [with _Val = std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>, _Key = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _HashFcn = __gnu_cxx::hash<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _ExtractKey = std::_Select1st<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> >, _EqualKey = std::equal_to<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _Alloc = std::allocator<int>]'",
- "instantiated from here",
- },
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ "instantiated from here", },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_RequiredFromHere() throws IOException {
- runParserTest(
- new String[] {
- "utils/bar.hpp:61:7: required from 'static void OpenCVUtils::show_contours_d(std::string, cv::Mat&, const std::vector<std::vector<cv::Point_<_Tp> > >&, bool, const Scalar&, int, int, int) [with T = int; std::string = std::basic_string<char>; cv::Scalar = cv::Scalar_<double>]'",
- "utils/foo.cpp:117:96: required from here",
- },
- 0, // errors
+ runParserTest(new String[] {
+ "utils/bar.hpp:61:7: required from 'static void OpenCVUtils::show_contours_d(std::string, cv::Mat&, const std::vector<std::vector<cv::Point_<_Tp> > >&, bool, const Scalar&, int, int, int) [with T = int; std::string = std::basic_string<char>; cv::Scalar = cv::Scalar_<double>]'",
+ "utils/foo.cpp:117:96: required from here", }, 0, // errors
0, // warnings
2, // infos
- new String[] {
- "bar.hpp",
- "foo.cpp",
- },
+ new String[] { "bar.hpp", "foo.cpp", },
new String[] {
"required from 'static void OpenCVUtils::show_contours_d(std::string, cv::Mat&, const std::vector<std::vector<cv::Point_<_Tp> > >&, bool, const Scalar&, int, int, int) [with T = int; std::string = std::basic_string<char>; cv::Scalar = cv::Scalar_<double>]'",
- "required from here",
- },
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ "required from here", },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_Infos() throws IOException {
runParserTest(
- new String[] {
- "foo.c:5: note: Offset of packed bit-field 'b' has changed in GCC 4.4",
- "bar.c:7: Info: foo undeclared, assumed to return int",
- },
+ new String[] { "foo.c:5: note: Offset of packed bit-field 'b' has changed in GCC 4.4",
+ "bar.c:7: Info: foo undeclared, assumed to return int", },
0, // errors
0, // warnings
2, // infos
- new String[] {"bar.c", "foo.c"},
- new String[] {
- "Offset of packed bit-field 'b' has changed in GCC 4.4",
- "foo undeclared, assumed to return int",
- },
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ new String[] { "bar.c", "foo.c" },
+ new String[] { "Offset of packed bit-field 'b' has changed in GCC 4.4",
+ "foo undeclared, assumed to return int", },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
+
public void testGccErrorMessages_DangerousFunction_bug248669() throws IOException {
runParserTest(
- new String[] {
- "mktemp.o(.text+0x19): In function 'main':",
- "mktemp.c:15: the use of 'mktemp' is dangerous, better use 'mkstemp'",
- },
+ new String[] { "mktemp.o(.text+0x19): In function 'main':",
+ "mktemp.c:15: the use of 'mktemp' is dangerous, better use 'mkstemp'", },
0, // errors
1, // warnings
- new String[] {"mktemp.c"},
- new String[] {"the use of 'mktemp' is dangerous, better use 'mkstemp'",},
- new String[] {GCC_ERROR_PARSER_ID}
- );
+ new String[] { "mktemp.c" }, new String[] { "the use of 'mktemp' is dangerous, better use 'mkstemp'", },
+ new String[] { GCC_ERROR_PARSER_ID });
}
-
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GLDErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GLDErrorParserTests.java
index d9b53c350d2..599de3c4d5c 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GLDErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GLDErrorParserTests.java
@@ -13,13 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.core.internal.errorparsers.tests;
-
import java.io.IOException;
import junit.framework.Test;
import junit.framework.TestSuite;
-
/**
* This test is designed to exercise the error parser capabilities for GNU ld.
*/
@@ -37,107 +35,73 @@ public class GLDErrorParserTests extends GenericErrorParserTests {
public void testLinkerMessages0() throws IOException {
runParserTest(
// old style: no colons before sections
- new String[] {
- "make -k all",
- "gcc -o hallo.o main.c libfoo.a",
+ new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a",
"main.c(.text+0x14): undefined reference to `foo()'",
"main.o(.rodata+0x14): undefined reference to `something'",
- "make: Target `all' not remade because of errors.",
- },
+ "make: Target `all' not remade because of errors.", },
2, // errors
0, // warnings
0, // Infos
- new String[] {"main.c","main.o"},
- new String[] {
- "undefined reference to `foo()'",
- "undefined reference to `something'"
- },
- new String[]{GLD_ERROR_PARSER_ID}
- );
+ new String[] { "main.c", "main.o" },
+ new String[] { "undefined reference to `foo()'", "undefined reference to `something'" },
+ new String[] { GLD_ERROR_PARSER_ID });
}
-
+
public void testLinkerMessages1() throws IOException {
runParserTest(
// new style: colons before sections
- new String[] {
- "make -k all",
- "gcc -o hallo.o main.c libfoo.a",
+ new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a",
"main.c:(.text+0x14): undefined reference to `foo()'",
"main.o:(.rodata+0x14): undefined reference to `something'",
- "make: Target `all' not remade because of errors.",
- },
+ "make: Target `all' not remade because of errors.", },
2, // errors
0, // warnings
0, // Infos
- new String[] {"main.c","main.o"},
- new String[] {
- "undefined reference to `foo()'",
- "undefined reference to `something'"
- },
- new String[]{GLD_ERROR_PARSER_ID}
- );
+ new String[] { "main.c", "main.o" },
+ new String[] { "undefined reference to `foo()'", "undefined reference to `something'" },
+ new String[] { GLD_ERROR_PARSER_ID });
}
public void testLinkerMessages2() throws IOException {
runParserTest(
- new String[] {
- "make -k all",
- "gcc -o hallo.o main.c libfoo.a",
- "libfoo.a(foo.o): In function `foo':",
+ new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a", "libfoo.a(foo.o): In function `foo':",
"foo.c:(.text+0x7): undefined reference to `bar'",
- "make: Target `all' not remade because of errors.",
- },
+ "make: Target `all' not remade because of errors.", },
1, // errors
0, // warnings
0, // Infos
- new String[] {"foo.c"},
- new String[] {"undefined reference to `bar'"},
- new String[] {GLD_ERROR_PARSER_ID}
- );
+ new String[] { "foo.c" }, new String[] { "undefined reference to `bar'" },
+ new String[] { GLD_ERROR_PARSER_ID });
}
public void testLinkerMessages_DangerousFunction_bug248669() throws IOException {
- runParserTest(
- new String[] {
- "mktemp.o(.text+0x19): In function 'main':",
- "mktemp.c:15: the use of 'mktemp' is dangerous, better use 'mkstemp'",
- "1.o: In function `main':",
- "1.c:(.text+0x19): warning: the use of `mktemp' is dangerous, better use `mkstemp'",
- },
- 0, // errors
+ runParserTest(new String[] { "mktemp.o(.text+0x19): In function 'main':",
+ "mktemp.c:15: the use of 'mktemp' is dangerous, better use 'mkstemp'", "1.o: In function `main':",
+ "1.c:(.text+0x19): warning: the use of `mktemp' is dangerous, better use `mkstemp'", }, 0, // errors
2, // warnings
0, // Infos
- new String[] {"1.c", "mktemp.c"},
- new String[] {
- "the use of 'mktemp' is dangerous, better use 'mkstemp'",
- "the use of `mktemp' is dangerous, better use `mkstemp'",
- },
- new String[] {GLD_ERROR_PARSER_ID}
- );
+ new String[] { "1.c", "mktemp.c" },
+ new String[] { "the use of 'mktemp' is dangerous, better use 'mkstemp'",
+ "the use of `mktemp' is dangerous, better use `mkstemp'", },
+ new String[] { GLD_ERROR_PARSER_ID });
}
-
+
public void testLinkerMessages_PrecedingPath_bug314253() throws IOException {
- runParserTest(
- new String[] {
- "ld: warning: libstdc++.so.5, needed by testlib_1.so, may conflict with libstdc++.so.6",
- "/usr/bin/ld: warning: libstdc++.so.5, needed by testlib_2.so, may conflict with libstdc++.so.6",
- "C:\\bin\\ld.exe: warning: libstdc++.so.5, needed by testlib_3.so, may conflict with libstdc++.so.6",
- "c:/bin/ld.exe: warning: libstdc++.so.5, needed by testlib_4.so, may conflict with libstdc++.so.6",
- "D:\\mingw\\bin\\..\\lib\\gcc-lib\\mingw32\\3.2.3\\..\\..\\..\\..\\mingw32\\bin\\ld.exe: cannot find -ljpeg",
- "notld: warning: ld error parser has no business parsing this message",
- },
- 1, // errors
+ runParserTest(new String[] {
+ "ld: warning: libstdc++.so.5, needed by testlib_1.so, may conflict with libstdc++.so.6",
+ "/usr/bin/ld: warning: libstdc++.so.5, needed by testlib_2.so, may conflict with libstdc++.so.6",
+ "C:\\bin\\ld.exe: warning: libstdc++.so.5, needed by testlib_3.so, may conflict with libstdc++.so.6",
+ "c:/bin/ld.exe: warning: libstdc++.so.5, needed by testlib_4.so, may conflict with libstdc++.so.6",
+ "D:\\mingw\\bin\\..\\lib\\gcc-lib\\mingw32\\3.2.3\\..\\..\\..\\..\\mingw32\\bin\\ld.exe: cannot find -ljpeg",
+ "notld: warning: ld error parser has no business parsing this message", }, 1, // errors
4, // warnings
0, // Infos
null,
- new String[] {
- "libstdc++.so.5, needed by testlib_1.so, may conflict with libstdc++.so.6",
+ new String[] { "libstdc++.so.5, needed by testlib_1.so, may conflict with libstdc++.so.6",
"libstdc++.so.5, needed by testlib_2.so, may conflict with libstdc++.so.6",
"libstdc++.so.5, needed by testlib_3.so, may conflict with libstdc++.so.6",
"libstdc++.so.5, needed by testlib_4.so, may conflict with libstdc++.so.6",
- "cannot find -ljpeg",
- },
- new String[] {GLD_ERROR_PARSER_ID}
- );
+ "cannot find -ljpeg", },
+ new String[] { GLD_ERROR_PARSER_ID });
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java
index e88b481fdab..1984e351158 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GenericErrorParserTests.java
@@ -46,7 +46,7 @@ public abstract class GenericErrorParserTests extends TestCase {
/**
* Constructor for IndexManagerTest.
- *
+ *
* @param name
*/
public GenericErrorParserTests(String name) {
@@ -93,11 +93,12 @@ public abstract class GenericErrorParserTests extends TestCase {
return buf.toString();
}
- protected void transferInputStreamToOutputStream(InputStream input, OutputStream output, int byteBlockSize) throws IOException {
+ protected void transferInputStreamToOutputStream(InputStream input, OutputStream output, int byteBlockSize)
+ throws IOException {
byte[] buffer = new byte[byteBlockSize];
int bytesRead;
- while ( (bytesRead = input.read(buffer)) >= 0) {
+ while ((bytesRead = input.read(buffer)) >= 0) {
output.write(buffer, 0, bytesRead);
}
@@ -106,12 +107,13 @@ public abstract class GenericErrorParserTests extends TestCase {
protected void runParserTest(InputStream inputStream, int expectedErrorCount, int expectedWarningCount,
String[] expectedFileNames, String[] expectedDescriptions, String[] parserID) throws IOException {
- runParserTest(inputStream, expectedErrorCount, expectedWarningCount, 0, expectedFileNames, expectedDescriptions, parserID);
+ runParserTest(inputStream, expectedErrorCount, expectedWarningCount, 0, expectedFileNames, expectedDescriptions,
+ parserID);
}
-
+
protected void runParserTest(InputStream inputStream, int expectedErrorCount, int expectedWarningCount,
- int expectedInfoCount, String[] expectedFileNames, String[] expectedDescriptions,
- String[] parserID) throws IOException {
+ int expectedInfoCount, String[] expectedFileNames, String[] expectedDescriptions, String[] parserID)
+ throws IOException {
assertNotNull(inputStream);
CountingMarkerGenerator markerGenerator = new CountingMarkerGenerator();
@@ -139,7 +141,7 @@ public abstract class GenericErrorParserTests extends TestCase {
assertEquals(expectedFileNames.length, markerGenerator.uniqFiles.size());
for (int i = 0; i < expectedFileNames.length; i++) {
// Keep in mind that uniqFiles get alphabetically sorted
- IPath path = ((IFile)markerGenerator.uniqFiles.get(i)).getLocation();
+ IPath path = ((IFile) markerGenerator.uniqFiles.get(i)).getLocation();
assertEquals(expectedFileNames[i], path.lastSegment());
}
}
@@ -147,24 +149,26 @@ public abstract class GenericErrorParserTests extends TestCase {
if (expectedDescriptions != null) {
assertNotNull(markerGenerator.descriptions);
for (int i = 0; i < expectedDescriptions.length; i++) {
- assertEquals(expectedDescriptions[i],markerGenerator.descriptions.get(i));
+ assertEquals(expectedDescriptions[i], markerGenerator.descriptions.get(i));
}
}
}
protected void runParserTest(String[] dataStream, int expectedErrorCount, int expectedWarningCount,
String[] expectedFileNames, String[] expectedDescriptions, String[] parserID) throws IOException {
- runParserTest(dataStream, expectedErrorCount, expectedWarningCount, 0, expectedFileNames, expectedDescriptions, parserID);
+ runParserTest(dataStream, expectedErrorCount, expectedWarningCount, 0, expectedFileNames, expectedDescriptions,
+ parserID);
}
-
- protected void runParserTest(String[] dataStream, int expectedErrorCount, int expectedWarningCount, int expectedInfoCount,
- String[] expectedFileNames, String[] expectedDescriptions, String[] parserID) throws IOException {
+
+ protected void runParserTest(String[] dataStream, int expectedErrorCount, int expectedWarningCount,
+ int expectedInfoCount, String[] expectedFileNames, String[] expectedDescriptions, String[] parserID)
+ throws IOException {
String errorStream = makeStringFromArray(dataStream, "\n");
ByteArrayInputStream inputStream = new ByteArrayInputStream(errorStream.getBytes());
- runParserTest(inputStream, expectedErrorCount, expectedWarningCount, expectedInfoCount,
- expectedFileNames, expectedDescriptions, parserID);
+ runParserTest(inputStream, expectedErrorCount, expectedWarningCount, expectedInfoCount, expectedFileNames,
+ expectedDescriptions, parserID);
}
private static class FileNameComparator implements Comparator<IResource> {
@@ -188,7 +192,8 @@ public abstract class GenericErrorParserTests extends TestCase {
@Override
public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
- ProblemMarkerInfo problemMarkerInfo = new ProblemMarkerInfo(file, lineNumber, errorDesc, severity, errorVar, null);
+ ProblemMarkerInfo problemMarkerInfo = new ProblemMarkerInfo(file, lineNumber, errorDesc, severity, errorVar,
+ null);
addMarker(problemMarkerInfo);
}
@@ -199,7 +204,8 @@ public abstract class GenericErrorParserTests extends TestCase {
uniqFiles.add(-1 * (index + 1), problemMarkerInfo.file);
}
- if (problemMarkerInfo.severity == SEVERITY_ERROR_BUILD || problemMarkerInfo.severity == SEVERITY_ERROR_RESOURCE) {
+ if (problemMarkerInfo.severity == SEVERITY_ERROR_BUILD
+ || problemMarkerInfo.severity == SEVERITY_ERROR_RESOURCE) {
numErrors++;
} else if (problemMarkerInfo.severity == SEVERITY_WARNING) {
numWarnings++;
@@ -235,14 +241,14 @@ public abstract class GenericErrorParserTests extends TestCase {
@Override
public IFile findFileName(String fileName) {
- if (fileName==null || fileName.trim().length()==0) {
+ if (fileName == null || fileName.trim().length() == 0) {
return null;
}
if (fileName.lastIndexOf('/') != -1) {
fileName = fileName.substring(fileName.lastIndexOf('/') + 1);
}
IFile file = fProject.getFile(fileName);
- if (file!=null && !file.exists()) {
+ if (file != null && !file.exists()) {
try {
InputStream stream = new ByteArrayInputStream("TestFile".getBytes());
file.create(stream, true, new NullProgressMonitor());
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/MakeErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/MakeErrorParserTests.java
index acf91ed9313..d5f3263231f 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/MakeErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/MakeErrorParserTests.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.internal.errorparsers.tests;
-
import java.io.IOException;
import junit.framework.Test;
@@ -21,60 +20,49 @@ import junit.framework.TestSuite;
import org.eclipse.cdt.core.ErrorParserManager;
-
/**
* This test is designed to exercise the error parser capabilities for GNU make.
*/
public class MakeErrorParserTests extends GenericErrorParserTests {
private static final String[] GMAKE_ERROR_STREAM0 = {
- // Infos
- "make: [Hello.o] Error 1 (ignored)",
- "make[2]: [all] Error 2 (ignored)",
- // Warnings
- "make: [Hello.o] Error 1",
- "make: Circular .folder/file.h <- .folder/file2.h dependency dropped.",
- "make[1]: Circular folder/file.h <- Makefile dependency dropped.",
- // Errors
- "make: *** [Hello.o] Error 1",
- "make[3]: *** [Hello.o] Error 1",
- "make: *** No rule to make target `one', needed by `all'. Stop.",
- "make: *** No rule to make target `all'. Stop.",
- "make: *** missing.mk: No such file or directory. Stop.",
- "make: Target `all' not remade because of errors.",
- // Ignored
- "make[3]: Nothing to be done for `all'.",
- "make[2]: `all' is up to date.",
- };
+ // Infos
+ "make: [Hello.o] Error 1 (ignored)", "make[2]: [all] Error 2 (ignored)",
+ // Warnings
+ "make: [Hello.o] Error 1", "make: Circular .folder/file.h <- .folder/file2.h dependency dropped.",
+ "make[1]: Circular folder/file.h <- Makefile dependency dropped.",
+ // Errors
+ "make: *** [Hello.o] Error 1", "make[3]: *** [Hello.o] Error 1",
+ "make: *** No rule to make target `one', needed by `all'. Stop.",
+ "make: *** No rule to make target `all'. Stop.", "make: *** missing.mk: No such file or directory. Stop.",
+ "make: Target `all' not remade because of errors.",
+ // Ignored
+ "make[3]: Nothing to be done for `all'.", "make[2]: `all' is up to date.", };
private static final int GMAKE_ERROR_STREAM0_INFOS = 2;
private static final int GMAKE_ERROR_STREAM0_WARNINGS = 3;
private static final int GMAKE_ERROR_STREAM0_ERRORS = 6;
private static final String[] GMAKE_ERROR_STREAM1 = {
- // Warning
- "GNUmakefile:12: warning: overriding commands for target `target'",
- "Makefile1:10: include.mk: No such file or directory",
- // Errors
- "Makefile2:10: *** missing separator. Stop.",
- "Makefile3:10: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.",
- "Makefile4:10: *** commands commence before first target. Stop.",
- "Makefile5:10: *** Recursive variable 'VAR' references itself (eventually). Stop.",
- "Makefile6:10: *** target pattern contains no `%'. Stop.",
- // Ignored. Do not intercept compiler warnings
- "mytest.cpp:19: warning: unused variable 'i'",
- "hello.c:14:17: error: foo.h: No such file or directory",
- };
+ // Warning
+ "GNUmakefile:12: warning: overriding commands for target `target'",
+ "Makefile1:10: include.mk: No such file or directory",
+ // Errors
+ "Makefile2:10: *** missing separator. Stop.",
+ "Makefile3:10: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.",
+ "Makefile4:10: *** commands commence before first target. Stop.",
+ "Makefile5:10: *** Recursive variable 'VAR' references itself (eventually). Stop.",
+ "Makefile6:10: *** target pattern contains no `%'. Stop.",
+ // Ignored. Do not intercept compiler warnings
+ "mytest.cpp:19: warning: unused variable 'i'", "hello.c:14:17: error: foo.h: No such file or directory", };
private static final int GMAKE_ERROR_STREAM1_WARNINGS = 2;
private static final int GMAKE_ERROR_STREAM1_ERRORS = 5;
- private static final String[] GMAKE_ERROR_STREAM1_FILENAMES = {"GNUmakefile", "Makefile1",
- "Makefile2", "Makefile3", "Makefile4", "Makefile5", "Makefile6"};
+ private static final String[] GMAKE_ERROR_STREAM1_FILENAMES = { "GNUmakefile", "Makefile1", "Makefile2",
+ "Makefile3", "Makefile4", "Makefile5", "Makefile6" };
private static final String[] GMAKE_ERROR_STREAM2 = {
- // Errors
- "gmake[3]: *** [Hello.o] Error 1",
- "make-381.exe: *** [Hello.o] Error 1",
- "gmake381: Target `all' not remade because of errors.",
- };
+ // Errors
+ "gmake[3]: *** [Hello.o] Error 1", "make-381.exe: *** [Hello.o] Error 1",
+ "gmake381: Target `all' not remade because of errors.", };
private static final int GMAKE_ERROR_STREAM2_WARNINGS = 0;
private static final int GMAKE_ERROR_STREAM2_ERRORS = 3;
@@ -92,17 +80,17 @@ public class MakeErrorParserTests extends GenericErrorParserTests {
}
public void testGmakeMessages0() throws IOException {
- runParserTest(GMAKE_ERROR_STREAM0, GMAKE_ERROR_STREAM0_ERRORS, GMAKE_ERROR_STREAM0_WARNINGS, GMAKE_ERROR_STREAM0_INFOS,
- null, null, new String[]{GMAKE_ERROR_PARSER_ID});
+ runParserTest(GMAKE_ERROR_STREAM0, GMAKE_ERROR_STREAM0_ERRORS, GMAKE_ERROR_STREAM0_WARNINGS,
+ GMAKE_ERROR_STREAM0_INFOS, null, null, new String[] { GMAKE_ERROR_PARSER_ID });
}
public void testGMakeMessages1() throws IOException {
runParserTest(GMAKE_ERROR_STREAM1, GMAKE_ERROR_STREAM1_ERRORS, GMAKE_ERROR_STREAM1_WARNINGS,
- GMAKE_ERROR_STREAM1_FILENAMES, null, new String[]{GMAKE_ERROR_PARSER_ID});
+ GMAKE_ERROR_STREAM1_FILENAMES, null, new String[] { GMAKE_ERROR_PARSER_ID });
}
public void testGmakeMessages2() throws IOException {
- runParserTest(GMAKE_ERROR_STREAM2, GMAKE_ERROR_STREAM2_ERRORS, GMAKE_ERROR_STREAM2_WARNINGS,
- null, null, new String[]{GMAKE_ERROR_PARSER_ID});
+ runParserTest(GMAKE_ERROR_STREAM2, GMAKE_ERROR_STREAM2_ERRORS, GMAKE_ERROR_STREAM2_WARNINGS, null, null,
+ new String[] { GMAKE_ERROR_PARSER_ID });
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java
index 0c4cb8ee827..aed5a8b40aa 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/RegexErrorParserTests.java
@@ -53,7 +53,8 @@ public class RegexErrorParserTests extends TestCase {
private final IMarkerGenerator markerGenerator = new IMarkerGenerator() {
// deprecated
@Override
- public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {}
+ public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
+ }
@Override
public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
@@ -124,12 +125,12 @@ public class RegexErrorParserTests extends TestCase {
*/
public void testRegexErrorParserAddDeletePattern() throws Exception {
RegexErrorParser regexErrorParser = new RegexErrorParser();
- regexErrorParser.addPattern(new RegexErrorPattern("pattern 1",
- null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
- regexErrorParser.addPattern(new RegexErrorPattern("delete me",
- null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
- regexErrorParser.addPattern(new RegexErrorPattern("pattern 3",
- null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
+ regexErrorParser.addPattern(
+ new RegexErrorPattern("pattern 1", null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
+ regexErrorParser.addPattern(
+ new RegexErrorPattern("delete me", null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
+ regexErrorParser.addPattern(
+ new RegexErrorPattern("pattern 3", null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
// adding patterns
RegexErrorPattern[] patternsBefore = regexErrorParser.getPatterns();
@@ -151,7 +152,7 @@ public class RegexErrorParserTests extends TestCase {
* @throws Exception...
*/
public void testRegexErrorParserPatternOrder() throws Exception {
- final int ERR=IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
+ final int ERR = IMarkerGenerator.SEVERITY_ERROR_RESOURCE;
RegexErrorParser regexErrorParser = new RegexErrorParser();
RegexErrorPattern removable = new RegexErrorPattern("CCC", null, null, null, null, ERR, true);
regexErrorParser.addPattern(new RegexErrorPattern("AAA", null, null, null, null, ERR, true));
@@ -187,71 +188,71 @@ public class RegexErrorParserTests extends TestCase {
*/
public void testRegexErrorParserParseOutput() throws Exception {
RegexErrorParser regexErrorParser = new RegexErrorParser();
- regexErrorParser.addPattern(new RegexErrorPattern("(.*)#(.*)#(.*)#(.*)",
- "$1", "$2", "$3 $4", "var=$4", IMarkerGenerator.SEVERITY_ERROR_RESOURCE, true));
- regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(skip me)!(.*)!(.*)",
- null, null, null, null, RegexErrorPattern.SEVERITY_SKIP, true));
- regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(Description)!(.*)!(.*)",
- "$4", "$3", "$2", "$1", IMarkerGenerator.SEVERITY_WARNING, /*eat-line*/ false));
+ regexErrorParser.addPattern(new RegexErrorPattern("(.*)#(.*)#(.*)#(.*)", "$1", "$2", "$3 $4", "var=$4",
+ IMarkerGenerator.SEVERITY_ERROR_RESOURCE, true));
+ regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(skip me)!(.*)!(.*)", null, null, null, null,
+ RegexErrorPattern.SEVERITY_SKIP, true));
+ regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(Description)!(.*)!(.*)", "$4", "$3", "$2", "$1",
+ IMarkerGenerator.SEVERITY_WARNING, /*eat-line*/ false));
// broken pattern
- regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(.*)",
- "$6", "$7", "$8", "$9", IMarkerGenerator.SEVERITY_WARNING, true));
- regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(.*)!(.*)!(.*)",
- null, null, null, null, IMarkerGenerator.SEVERITY_INFO, true));
+ regexErrorParser.addPattern(
+ new RegexErrorPattern("(.*)!(.*)", "$6", "$7", "$8", "$9", IMarkerGenerator.SEVERITY_WARNING, true));
+ regexErrorParser.addPattern(new RegexErrorPattern("(.*)!(.*)!(.*)!(.*)", null, null, null, null,
+ IMarkerGenerator.SEVERITY_INFO, true));
String fileName = "RegexErrorParser.c";
ResourceHelper.createFile(fProject, fileName);
errorList.clear();
ErrorParserManager epManager = new ErrorParserManager(fProject, markerGenerator, new String[0]);
-
+
ProblemMarkerInfo problemMarkerInfo;
// Regular pattern
- regexErrorParser.processLine(fileName+"#10#Description#Variable", epManager);
+ regexErrorParser.processLine(fileName + "#10#Description#Variable", epManager);
// This should get ignored
- regexErrorParser.processLine("Variable!skip me!10!"+fileName, epManager);
+ regexErrorParser.processLine("Variable!skip me!10!" + fileName, epManager);
// Eat-line=false + qualifying next pattern (nulls), i.e. generates 2 problems
- regexErrorParser.processLine("Variable!Description!10!"+fileName, epManager);
+ regexErrorParser.processLine("Variable!Description!10!" + fileName, epManager);
assertEquals(3, errorList.size());
// Regular
problemMarkerInfo = errorList.get(0);
assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, problemMarkerInfo.severity);
- assertEquals("L/"+TEST_PROJECT_NAME+"/"+fileName, problemMarkerInfo.file.toString());
+ assertEquals("L/" + TEST_PROJECT_NAME + "/" + fileName, problemMarkerInfo.file.toString());
assertEquals(fileName, problemMarkerInfo.file.getName());
assertEquals(10, problemMarkerInfo.lineNumber);
- assertEquals("Description Variable",problemMarkerInfo.description);
- assertEquals("var=Variable",problemMarkerInfo.variableName);
+ assertEquals("Description Variable", problemMarkerInfo.description);
+ assertEquals("var=Variable", problemMarkerInfo.variableName);
// Eat-line
problemMarkerInfo = errorList.get(1);
assertEquals(IMarkerGenerator.SEVERITY_WARNING, problemMarkerInfo.severity);
- assertEquals("L/"+TEST_PROJECT_NAME+"/"+fileName, problemMarkerInfo.file.toString());
+ assertEquals("L/" + TEST_PROJECT_NAME + "/" + fileName, problemMarkerInfo.file.toString());
assertEquals(fileName, problemMarkerInfo.file.getName());
assertEquals(10, problemMarkerInfo.lineNumber);
- assertEquals("Description",problemMarkerInfo.description);
- assertEquals("Variable",problemMarkerInfo.variableName);
+ assertEquals("Description", problemMarkerInfo.description);
+ assertEquals("Variable", problemMarkerInfo.variableName);
// Nulls
problemMarkerInfo = errorList.get(2);
assertEquals(IMarkerGenerator.SEVERITY_INFO, problemMarkerInfo.severity);
- assertEquals("P/"+TEST_PROJECT_NAME, problemMarkerInfo.file.toString());
+ assertEquals("P/" + TEST_PROJECT_NAME, problemMarkerInfo.file.toString());
assertEquals(0, problemMarkerInfo.lineNumber);
- assertEquals("",problemMarkerInfo.description);
- assertEquals("",problemMarkerInfo.variableName);
+ assertEquals("", problemMarkerInfo.description);
+ assertEquals("", problemMarkerInfo.variableName);
// clone & equals
- RegexErrorParser cloned = (RegexErrorParser)regexErrorParser.clone();
- assertTrue(cloned!=regexErrorParser);
+ RegexErrorParser cloned = (RegexErrorParser) regexErrorParser.clone();
+ assertTrue(cloned != regexErrorParser);
assertEquals(regexErrorParser, cloned);
- assertTrue(cloned.getPatterns()!=regexErrorParser.getPatterns());
+ assertTrue(cloned.getPatterns() != regexErrorParser.getPatterns());
assertEquals(cloned.getPatterns().length, regexErrorParser.getPatterns().length);
- for (int i=0; i<regexErrorParser.getPatterns().length; i++) {
+ for (int i = 0; i < regexErrorParser.getPatterns().length; i++) {
// Checking deep copy
- assertTrue(cloned.getPatterns()[i]!=regexErrorParser.getPatterns()[i]);
- assertEquals(cloned.getPatterns()[i],regexErrorParser.getPatterns()[i]);
+ assertTrue(cloned.getPatterns()[i] != regexErrorParser.getPatterns()[i]);
+ assertEquals(cloned.getPatterns()[i], regexErrorParser.getPatterns()[i]);
}
}
@@ -287,7 +288,7 @@ public class RegexErrorParserTests extends TestCase {
assertEquals(REGEX_ERRORPARSER_NAME, errorParser.getName());
assertTrue(errorParser instanceof RegexErrorParser);
- RegexErrorParser regexErrorParser = (RegexErrorParser)errorParser;
+ RegexErrorParser regexErrorParser = (RegexErrorParser) errorParser;
assertEquals(REGEX_ERRORPARSER_ID, regexErrorParser.getId());
assertEquals(REGEX_ERRORPARSER_NAME, regexErrorParser.getName());
@@ -309,7 +310,7 @@ public class RegexErrorParserTests extends TestCase {
IErrorParser errorParser = ErrorParserManager.getErrorParserCopy(REGEX_ERRORPARSER_ID);
assertTrue(errorParser instanceof RegexErrorParser);
- RegexErrorParser regexErrorParser = (RegexErrorParser)errorParser;
+ RegexErrorParser regexErrorParser = (RegexErrorParser) errorParser;
assertEquals(REGEX_ERRORPARSER_ID, regexErrorParser.getId());
assertEquals(REGEX_ERRORPARSER_NAME, regexErrorParser.getName());
}
@@ -334,19 +335,19 @@ public class RegexErrorParserTests extends TestCase {
String name = ErrorParserManager.getErrorParserCopy(id).getName();
boolean isDeprecated = name.contains("(Deprecated)");
boolean isTestPlugin = id.startsWith(CTestPlugin.PLUGIN_ID);
- String message = "Parser ["+lastName+"] preceeds ["+name+"]";
-
+ String message = "Parser [" + lastName + "] preceeds [" + name + "]";
+
// inside the same category sorted by names
- if (lastIsDeprecated==isDeprecated && lastIsTestPlugin==isTestPlugin) {
- assertTrue(message, lastName.compareTo(name)<=0);
+ if (lastIsDeprecated == isDeprecated && lastIsTestPlugin == isTestPlugin) {
+ assertTrue(message, lastName.compareTo(name) <= 0);
}
// deprecated follow non-deprecated (unless parsers from test plugin show up)
- if (lastIsTestPlugin==isTestPlugin) {
- assertFalse(message, lastIsDeprecated==true && isDeprecated==false);
+ if (lastIsTestPlugin == isTestPlugin) {
+ assertFalse(message, lastIsDeprecated == true && isDeprecated == false);
}
// error parsers from test plugin are the last
- assertFalse(message, lastIsTestPlugin==true && isTestPlugin==false);
-
+ assertFalse(message, lastIsTestPlugin == true && isTestPlugin == false);
+
lastName = name;
lastIsDeprecated = isDeprecated;
lastIsTestPlugin = isTestPlugin;
@@ -365,7 +366,7 @@ public class RegexErrorParserTests extends TestCase {
final String[] availableParserIds = ErrorParserManager.getErrorParserAvailableIds();
assertNotNull(availableParserIds);
- assertTrue(availableParserIds.length>0);
+ assertTrue(availableParserIds.length > 0);
final String firstId = ErrorParserManager.getErrorParserAvailableIds()[0];
final IErrorParserNamed firstErrorParser = ErrorParserManager.getErrorParserCopy(firstId);
assertNotNull(firstErrorParser);
@@ -392,8 +393,7 @@ public class RegexErrorParserTests extends TestCase {
// add brand new one
new ErrorParserNamedWrapper(TESTING_ID, TESTING_NAME, dummy1),
// override extension with another one
- new ErrorParserNamedWrapper(firstId, firstName, dummy2),
- });
+ new ErrorParserNamedWrapper(firstId, firstName, dummy2), });
String all = ErrorParserManager.toDelimitedString(ErrorParserManager.getErrorParserAvailableIds());
assertEquals(true, all.contains(TESTING_ID));
assertEquals(true, all.contains(firstId));
@@ -402,14 +402,14 @@ public class RegexErrorParserTests extends TestCase {
assertNotNull(retrieved1);
assertEquals(TESTING_NAME, retrieved1.getName());
assertTrue(retrieved1 instanceof ErrorParserNamedWrapper);
- assertEquals(dummy1, ((ErrorParserNamedWrapper)retrieved1).getErrorParser());
+ assertEquals(dummy1, ((ErrorParserNamedWrapper) retrieved1).getErrorParser());
IErrorParserNamed retrieved2 = ErrorParserManager.getErrorParserCopy(firstId);
assertNotNull(retrieved2);
assertEquals(firstName, retrieved2.getName());
assertTrue(retrieved2 instanceof ErrorParserNamedWrapper);
- assertEquals(dummy2, ((ErrorParserNamedWrapper)retrieved2).getErrorParser());
-
+ assertEquals(dummy2, ((ErrorParserNamedWrapper) retrieved2).getErrorParser());
+
IErrorParserNamed retrieved2_ext = ErrorParserManager.getErrorParserExtensionCopy(firstId);
assertNotNull(retrieved2_ext);
assertEquals(firstName, retrieved2_ext.getName());
@@ -453,9 +453,9 @@ public class RegexErrorParserTests extends TestCase {
}
{
ErrorParserManager.setUserDefinedErrorParsers(new IErrorParserNamed[] {
- new ErrorParserNamedWrapper(TESTING_ID, TESTING_NAME, new DummyErrorParser()),
- });
- String userDefinedIds = ErrorParserManager.toDelimitedString(ErrorParserManager.getUserDefinedErrorParserIds());
+ new ErrorParserNamedWrapper(TESTING_ID, TESTING_NAME, new DummyErrorParser()), });
+ String userDefinedIds = ErrorParserManager
+ .toDelimitedString(ErrorParserManager.getUserDefinedErrorParserIds());
assertEquals(TESTING_ID, userDefinedIds);
String all = ErrorParserManager.toDelimitedString(ErrorParserManager.getErrorParserAvailableIds());
@@ -483,11 +483,8 @@ public class RegexErrorParserTests extends TestCase {
}
// setDefaultErrorParserIds
{
- String[] newDefaultErrorParserIds = {
- "org.eclipse.cdt.core.test.errorparser0",
- "org.eclipse.cdt.core.test.errorparser1",
- "org.eclipse.cdt.core.test.errorparser2",
- };
+ String[] newDefaultErrorParserIds = { "org.eclipse.cdt.core.test.errorparser0",
+ "org.eclipse.cdt.core.test.errorparser1", "org.eclipse.cdt.core.test.errorparser2", };
ErrorParserManager.setDefaultErrorParserIds(newDefaultErrorParserIds);
String[] defaultErrorParserIds = ErrorParserManager.getDefaultErrorParserIds();
assertNotNull(defaultErrorParserIds);
@@ -518,7 +515,8 @@ public class RegexErrorParserTests extends TestCase {
// Create error parser
IErrorParser errorParser = new GASErrorParser();
// Add to available parsers
- ErrorParserExtensionManager.setUserDefinedErrorParsersInternal(new IErrorParserNamed[] {new ErrorParserNamedWrapper(TESTING_ID, TESTING_NAME, errorParser)});
+ ErrorParserExtensionManager.setUserDefinedErrorParsersInternal(
+ new IErrorParserNamed[] { new ErrorParserNamedWrapper(TESTING_ID, TESTING_NAME, errorParser) });
assertNotNull(ErrorParserManager.getErrorParserCopy(TESTING_ID));
assertEquals(TESTING_NAME, ErrorParserManager.getErrorParserCopy(TESTING_ID).getName());
// Serialize in persistent storage
@@ -537,7 +535,7 @@ public class RegexErrorParserTests extends TestCase {
assertNotNull(errorParser);
assertEquals(TESTING_NAME, errorParser.getName());
assertTrue(errorParser instanceof ErrorParserNamedWrapper);
- assertTrue(((ErrorParserNamedWrapper)errorParser).getErrorParser() instanceof GASErrorParser);
+ assertTrue(((ErrorParserNamedWrapper) errorParser).getErrorParser() instanceof GASErrorParser);
}
{
// Remove from available parsers as clean-up
@@ -559,11 +557,12 @@ public class RegexErrorParserTests extends TestCase {
{
// Create error parser with the same id as in eclipse registry
RegexErrorParser regexErrorParser = new RegexErrorParser(TESTING_ID, TESTING_NAME);
- regexErrorParser.addPattern(new RegexErrorPattern("Pattern-Y",
- "line-Y", "file-Y", "description-Y", null, IMarkerGenerator.SEVERITY_WARNING, false));
+ regexErrorParser.addPattern(new RegexErrorPattern("Pattern-Y", "line-Y", "file-Y", "description-Y", null,
+ IMarkerGenerator.SEVERITY_WARNING, false));
// Add to available parsers
- ErrorParserExtensionManager.setUserDefinedErrorParsersInternal(new IErrorParserNamed[] {regexErrorParser});
+ ErrorParserExtensionManager
+ .setUserDefinedErrorParsersInternal(new IErrorParserNamed[] { regexErrorParser });
assertNotNull(ErrorParserManager.getErrorParserCopy(TESTING_ID));
// And serialize in persistent storage
ErrorParserExtensionManager.serializeUserDefinedErrorParsers();
@@ -584,7 +583,7 @@ public class RegexErrorParserTests extends TestCase {
IErrorParser errorParser = ErrorParserManager.getErrorParserCopy(TESTING_ID);
assertNotNull(errorParser);
assertTrue(errorParser instanceof RegexErrorParser);
- RegexErrorParser regexErrorParser = (RegexErrorParser)errorParser;
+ RegexErrorParser regexErrorParser = (RegexErrorParser) errorParser;
assertEquals(TESTING_ID, regexErrorParser.getId());
assertEquals(TESTING_NAME, regexErrorParser.getName());
@@ -619,11 +618,12 @@ public class RegexErrorParserTests extends TestCase {
{
// Create error parser with the same id as in eclipse registry
RegexErrorParser regexErrorParser = new RegexErrorParser(TESTING_ID, TESTING_NAME);
- regexErrorParser.addPattern(new RegexErrorPattern(TESTING_REGEX,
- "line-<>\"'\\&", "file-<>\"'\\&", "description-<>\"'\\&", null, IMarkerGenerator.SEVERITY_WARNING, false));
+ regexErrorParser.addPattern(new RegexErrorPattern(TESTING_REGEX, "line-<>\"'\\&", "file-<>\"'\\&",
+ "description-<>\"'\\&", null, IMarkerGenerator.SEVERITY_WARNING, false));
// Add to available parsers
- ErrorParserExtensionManager.setUserDefinedErrorParsersInternal(new IErrorParserNamed[] {regexErrorParser});
+ ErrorParserExtensionManager
+ .setUserDefinedErrorParsersInternal(new IErrorParserNamed[] { regexErrorParser });
assertNotNull(ErrorParserManager.getErrorParserCopy(TESTING_ID));
// And serialize in persistent storage
ErrorParserExtensionManager.serializeUserDefinedErrorParsers();
@@ -638,7 +638,7 @@ public class RegexErrorParserTests extends TestCase {
IErrorParser errorParser = ErrorParserManager.getErrorParserCopy(TESTING_ID);
assertNotNull(errorParser);
assertTrue(errorParser instanceof RegexErrorParser);
- RegexErrorParser regexErrorParser = (RegexErrorParser)errorParser;
+ RegexErrorParser regexErrorParser = (RegexErrorParser) errorParser;
assertEquals(TESTING_ID, regexErrorParser.getId());
assertEquals(TESTING_NAME, regexErrorParser.getName());
@@ -654,11 +654,8 @@ public class RegexErrorParserTests extends TestCase {
* @throws Exception...
*/
public void testSerializeDefaultErrorParserIds() throws Exception {
- final String[] testingDefaultErrorParserIds = {
- "org.eclipse.cdt.core.test.errorparser0",
- "org.eclipse.cdt.core.test.errorparser1",
- "org.eclipse.cdt.core.test.errorparser2",
- };
+ final String[] testingDefaultErrorParserIds = { "org.eclipse.cdt.core.test.errorparser0",
+ "org.eclipse.cdt.core.test.errorparser1", "org.eclipse.cdt.core.test.errorparser2", };
final String TESTING_IDS = ErrorParserManager.toDelimitedString(testingDefaultErrorParserIds);
final String DEFAULT_IDS = ErrorParserManager.toDelimitedString(ErrorParserManager.getDefaultErrorParserIds());
@@ -677,7 +674,8 @@ public class RegexErrorParserTests extends TestCase {
{
// Remove from internal list
ErrorParserExtensionManager.setDefaultErrorParserIdsInternal(null);
- assertEquals(DEFAULT_IDS, ErrorParserManager.toDelimitedString(ErrorParserManager.getDefaultErrorParserIds()));
+ assertEquals(DEFAULT_IDS,
+ ErrorParserManager.toDelimitedString(ErrorParserManager.getDefaultErrorParserIds()));
}
{
@@ -722,12 +720,12 @@ public class RegexErrorParserTests extends TestCase {
assertTrue(clone1 instanceof ErrorParserNamedWrapper);
assertTrue(clone2 instanceof ErrorParserNamedWrapper);
- IErrorParser gccClone1 = ((ErrorParserNamedWrapper)clone1).getErrorParser();
- IErrorParser gccClone2 = ((ErrorParserNamedWrapper)clone2).getErrorParser();
+ IErrorParser gccClone1 = ((ErrorParserNamedWrapper) clone1).getErrorParser();
+ IErrorParser gccClone2 = ((ErrorParserNamedWrapper) clone2).getErrorParser();
assertNotSame(clone1, clone2);
}
}
-
+
/**
* Check how RegexErrorParser parses output.
*
@@ -735,8 +733,8 @@ public class RegexErrorParserTests extends TestCase {
*/
public void testRegexErrorParserExternalLocation_bug301338() throws Exception {
RegexErrorParser regexErrorParser = new RegexErrorParser();
- regexErrorParser.addPattern(new RegexErrorPattern("pattern",
- "", "", "", "$0", IMarkerGenerator.SEVERITY_ERROR_RESOURCE, true));
+ regexErrorParser.addPattern(
+ new RegexErrorPattern("pattern", "", "", "", "$0", IMarkerGenerator.SEVERITY_ERROR_RESOURCE, true));
errorList.clear();
ErrorParserManager epManager = new ErrorParserManager(fProject, markerGenerator, new String[0]);
@@ -747,5 +745,4 @@ public class RegexErrorParserTests extends TestCase {
assertEquals(0, errorList.size());
}
-
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/AbstractDummyProvider.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/AbstractDummyProvider.java
index 00279c1dc87..0603f7ff588 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/AbstractDummyProvider.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/AbstractDummyProvider.java
@@ -24,8 +24,9 @@ import org.eclipse.core.runtime.CoreException;
* project lifecycles.
*/
public class AbstractDummyProvider implements IReadOnlyPDOMProvider {
- public AbstractDummyProvider() {}
-
+ public AbstractDummyProvider() {
+ }
+
@Override
public IPDOMDescriptor[] getDescriptors(ICConfigurationDescription config) {
if (!DummyProviderTraces.getInstance().enabled)
@@ -33,7 +34,7 @@ public class AbstractDummyProvider implements IReadOnlyPDOMProvider {
DummyProviderTraces.getInstance().getCfgsTrace(getClass()).add(config);
return new IPDOMDescriptor[0];
}
-
+
@Override
public boolean providesFor(ICProject project) throws CoreException {
if (!DummyProviderTraces.getInstance().enabled)
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/DummyProviderTraces.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/DummyProviderTraces.java
index a20d46eb178..bbb59c7907c 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/DummyProviderTraces.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/DummyProviderTraces.java
@@ -21,33 +21,36 @@ import java.util.Map;
public class DummyProviderTraces {
static DummyProviderTraces instance = new DummyProviderTraces();
-
- public static DummyProviderTraces getInstance() { return instance; }
+
+ public static DummyProviderTraces getInstance() {
+ return instance;
+ }
/** Flag indicates if test is enabled, so we should trace projects and configs */
public volatile boolean enabled;
- private DummyProviderTraces() {}
-
- Map/*<String, List>*/ id2prjTrace= new HashMap();
- Map/*<String, List>*/ id2cfgTrace= new HashMap();
-
+ private DummyProviderTraces() {
+ }
+
+ Map/*<String, List>*/ id2prjTrace = new HashMap();
+ Map/*<String, List>*/ id2cfgTrace = new HashMap();
+
public List getProjectsTrace(Class provider) {
- String key= provider.getName();
- if(!id2prjTrace.containsKey(key)) {
+ String key = provider.getName();
+ if (!id2prjTrace.containsKey(key)) {
id2prjTrace.put(key, Collections.synchronizedList(new ArrayList()));
}
return (List) id2prjTrace.get(key);
}
-
+
public List getCfgsTrace(Class provider) {
- String key= provider.getName();
- if(!id2cfgTrace.containsKey(key)) {
+ String key = provider.getName();
+ if (!id2cfgTrace.containsKey(key)) {
id2cfgTrace.put(key, Collections.synchronizedList(new ArrayList()));
}
return (List) id2cfgTrace.get(key);
}
-
+
public void reset(Class provider) {
getProjectsTrace(provider).clear();
getCfgsTrace(provider).clear();
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/Providers.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/Providers.java
index 4b8df2a2135..6234a20e7cc 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/Providers.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/index/provider/test/Providers.java
@@ -17,14 +17,24 @@ import org.eclipse.cdt.core.index.provider.IPDOMDescriptor;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
public class Providers {
- public static class Dummy1 extends AbstractDummyProvider {}
- public static class Dummy2 extends AbstractDummyProvider {}
- public static class Dummy3 extends AbstractDummyProvider {}
- public static class Dummy4 extends AbstractDummyProvider {}
- public static class Dummy5 extends AbstractDummyProvider {}
-
- public static class Counter extends AbstractDummyProvider{
+ public static class Dummy1 extends AbstractDummyProvider {
+ }
+
+ public static class Dummy2 extends AbstractDummyProvider {
+ }
+
+ public static class Dummy3 extends AbstractDummyProvider {
+ }
+
+ public static class Dummy4 extends AbstractDummyProvider {
+ }
+
+ public static class Dummy5 extends AbstractDummyProvider {
+ }
+
+ public static class Counter extends AbstractDummyProvider {
public static int fCounter;
+
@Override
public IPDOMDescriptor[] getDescriptors(ICConfigurationDescription config) {
fCounter++;
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/PositionTrackerTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/PositionTrackerTests.java
index b909dcabdcb..41e1523a329 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/PositionTrackerTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/PositionTrackerTests.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.core.internal.tests;
import java.util.Random;
@@ -24,337 +24,331 @@ import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
public class PositionTrackerTests extends TestCase {
- public static Test suite() {
- return new TestSuite(PositionTrackerTests.class);
- }
-
- public void testInitialFailures() {
- int[][] moves = {
- {46, -18, 95, -76, 98, -89, 10, -10, 85, -80, 16, 6, 5, -3,
- 22, -8, 29, -20, 86, -62, 34, -21, 63, -41, 9, 10, 18, -7},
- {0, 2, 1,-4},
- {4,-1, 0, 2, 0,-5},
- {0, 1, 2, 1, 0,-5},
- {0, 1, 2,-3, 1,-4},
- {4, 3, 3,-2, 0,-1},
- {4,-1, 3, 1, 2,-1},
- {0, 1, 2, 8, 1,-8, 0,-10},
- {4,-1, 2, 1, 4, 1, 0,-1, 0,-5},
- };
- int[] buffer = new int[100];
- for (int i = 0; i < moves.length; i++) {
- testMove(buffer, moves[i]);
- }
- }
-
- public void testRotations() {
- int[][] moves = { { 0, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 1, 12, 1, 14, 1, 16, 1, 18, 1, 20, 1, 22, 1, 24, 1 }, {
- 15, 1, 14, 1, 13, 1, 12, 1, 11, 1, 10, 1, 9, 1, 8, 1, 7, 1, 6, 1, 5, 1, 4, 1, 3, 1 }, {
- 0, 1, 10, 1, 2, 1, 20, 1, 4, 1, 20, 1, 6, 1, 20, 1, 8, 1, 20, 1, 10, 1, 20, 1, 12, 1 }, };
- int[] buffer = new int[30];
- for (int i = 0; i < moves.length; i++) {
- assertTrue(testMove(buffer, moves[i]).depth() <= 5);
- }
- }
-
- public void testDepth4() {
- fullTest(5, 4);
- }
-
- public void testRandomDepth5() {
- randomTest(20, 5, 5, 1000);
- }
-
- public void testRandomDepth10() {
- randomTest(50, 10, 10, 1000);
- }
-
- public void testRandomDepth15() {
- randomTest(100, 15, 15, 1000);
- }
-
- public void testRandomDepth20() {
- randomTest(100, 15, 20, 1000);
- }
-
- public void testRetireDepth2() {
- randomRetireTest(100, 10, 25, 2, 1000);
- }
-
- public void testRetireDepth5() {
- randomRetireTest(100, 10, 10, 5, 1000);
- }
-
- public void testRetireDepth10() {
- randomRetireTest(100, 10, 5, 10, 1000);
- }
-
- public static void fullTest(int len, int depth) {
- // init buffer
- int[] buffer = new int[len];
- int[] move = new int[2 * depth];
- for (int i = 0; i < move.length; i++) {
- move[i] = -1;
- }
- while (nextMove(move, len)) {
- testMove(buffer, move);
- }
- }
-
- public static void randomTest(int buflen, int changelen, int depth, int count) {
- // init buffer
- Random rand = new Random();
-
- int[] buffer = new int[buflen];
- int[] move = new int[2 * depth];
-
- for (int j = 0; j < count; j++) {
- for (int i = 0; i < move.length; i += 2) {
- move[i] = rand.nextInt(buflen);
- move[i + 1] = rand.nextInt(2 * changelen) - changelen;
- }
- testMove(buffer, move);
- }
- }
-
- public static void randomRetireTest(int buflen, int changelen, int depth, int trackerDepth, int count) {
- // init buffer
- Random rand = new Random();
-
- int[] buffer = new int[buflen];
- int[] move = new int[2 * depth];
-
- for (int j = 0; j < count; j++) {
- for (int i = 0; i < buffer.length; i++) {
- buffer[i] = i;
- }
-
- PositionTracker t0 = null;
- PositionTracker previous = null;
- for (int t = 0; t < trackerDepth; t++) {
- for (int i = 0; i < move.length; i += 2) {
- move[i] = rand.nextInt(buflen);
- move[i + 1] = rand.nextInt(2 * changelen) - changelen;
- }
- PositionTracker tracker = new PositionTracker();
- if (previous != null) {
- previous.retire(tracker);
- }
- doMove(buffer, move, tracker);
- if (t0 == null) {
- t0 = tracker;
- }
- previous = tracker;
- }
- check(t0, buffer);
- }
- }
-
- static PositionTracker testMove(int[] buffer, int[] move) {
- try {
- return __testMove(buffer, move);
- } catch (RuntimeException e) {
- System.out.println("Error on move: "); //$NON-NLS-1$
- for (int i = 0; i < move.length; i++) {
- System.out.print(move[i] + ", "); //$NON-NLS-1$
- }
- System.out.println();
- throw e;
- } catch (Error e) {
- System.out.println("Error on move: "); //$NON-NLS-1$
- for (int i = 0; i < move.length; i++) {
- System.out.print(move[i] + ", "); //$NON-NLS-1$
- }
- System.out.println();
- throw e;
- }
- }
-
- static PositionTracker __testMove(int[] buffer, int[] move) {
- PositionTracker tracker = new PositionTracker();
- for (int i = 0; i < buffer.length; i++) {
- buffer[i] = i;
- }
- doMove(buffer, move, tracker);
- check(tracker, buffer);
- return tracker;
- }
-
- static void doMove(int[] buffer, int[] move, PositionTracker tracker) {
- for (int i = 0; i < move.length; i += 2) {
- int m1 = move[i];
- int m2 = move[i + 1];
- if (m1 == -1) {
- break;
- }
- if (m2 > 0) {
- tracker.insert(m1, m2);
- for (int j = 0; j < buffer.length; j++) {
- if (buffer[j] >= m1) {
- buffer[j] += m2;
- }
- }
- } else {
- tracker.delete(m1, -m2);
- int m3 = m1 - m2;
- for (int j = 0; j < buffer.length; j++) {
- if (buffer[j] >= m1) {
- if (buffer[j] < m3) {
- buffer[j] = -1;
- } else {
- buffer[j] += m2;
- }
- }
- }
- }
- }
- }
-
- private static void check(PositionTracker tracker, int[] buffer) {
- int lasti2 = -1;
- for (int i = 0; i < buffer.length; i++) {
- int i2 = buffer[i];
- if (i2 >= 0) {
- int i22 = tracker.currentOffset(i);
- assertEquals(i22, i2);
- assertTrue(lasti2 < i22);
- lasti2 = i22;
-
- assertEquals(i, tracker.historicOffset(i2));
- }
- }
- }
-
- private static boolean nextMove(int[] move, int bufLen) {
- for (int i = 0; i < move.length; i += 2) {
- int m1 = move[i];
- if (m1 < 0) {
- move[i] = 0;
- move[i + 1] = -bufLen;
- return true;
- }
- int m2 = ++move[i + 1];
- if (m2 <= bufLen - m1) {
- return true;
- }
- if (m1 < bufLen - 1) {
- move[i]++;
- move[i + 1] = -bufLen + m1 + 1;
- return true;
- }
- move[i] = 0;
- move[i + 1] = -bufLen;
- }
- return false;
- }
-
- public void testInsertion() {
- PositionTracker pt= new PositionTracker();
- pt.insert(1,1);
-
- checkInsert11(pt);
- }
-
- private void checkInsert11(PositionTracker pt) {
- // chars
- doubleCheck(pt, 0, 0);
- backwdCheck(pt, 1, 1);
- doubleCheck(pt, 1, 2);
- doubleCheck(pt, 2, 3);
-
- // ranges
- doubleRangeCheck(pt, new Region(0,2), new Region(0,3));
- backwdRangeCheck(pt, new Region(0,1), new Region(0,2));
- doubleRangeCheck(pt, new Region(0,1), new Region(0,1));
- backwdRangeCheck(pt, new Region(1,0), new Region(1,1));
- backwdRangeCheck(pt, new Region(1,0), new Region(1,0));
- doubleRangeCheck(pt, new Region(1,1), new Region(2,1));
- doubleRangeCheck(pt, new Region(1,0), new Region(2,0));
- }
-
- public void testDeletion() {
- PositionTracker pt= new PositionTracker();
- pt.delete(1,1);
- checkDelete11(pt);
- }
-
- private void checkDelete11(PositionTracker pt) {
- doubleCheck(pt, 0, 0);
- fwdCheck (pt, 1, 1);
- doubleCheck(pt, 2, 1);
- doubleCheck(pt, 3, 2);
-
- // ranges
- doubleRangeCheck(pt, new Region(0,3), new Region(0,2));
- fwdRangeCheck (pt, new Region(0,2), new Region(0,1));
- doubleRangeCheck(pt, new Region(0,1), new Region(0,1));
- fwdRangeCheck (pt, new Region(1,1), new Region(1,0));
- fwdRangeCheck (pt, new Region(1,0), new Region(1,0));
- doubleRangeCheck(pt, new Region(2,1), new Region(1,1));
- doubleRangeCheck(pt, new Region(2,0), new Region(1,0));
- }
-
- public void testReplace() {
- PositionTracker pt= new PositionTracker();
- pt.delete(1,1);
- pt.insert(1,1);
- doubleCheck(pt, 0, 0);
- doubleCheck(pt, 1, 1);
- doubleCheck(pt, 2, 2);
- doubleCheck(pt, 3, 3);
-
- pt.clear();
- pt.insert(1,1);
- pt.delete(1,1);
- doubleCheck(pt, 0, 0);
- doubleCheck(pt, 1, 1);
- doubleCheck(pt, 2, 2);
- doubleCheck(pt, 3, 3);
-
- pt.clear();
- pt.delete(0,2);
- pt.insert(0,1);
- checkDelete11(pt);
-
- pt.clear();
- pt.insert(1,1);
- pt.delete(1,2);
- checkDelete11(pt);
-
- pt.clear();
- pt.insert(1,2);
- pt.delete(1,1);
- checkInsert11(pt);
-
- pt.clear();
- pt.delete(1,1);
- pt.insert(1,2);
- checkInsert11(pt);
- }
-
- private void doubleCheck(PositionTracker pt, int orig, int mapped) {
- fwdCheck(pt, orig, mapped);
- backwdCheck(pt, orig, mapped);
- }
-
- private void fwdCheck(PositionTracker pt, int orig, int mapped) {
- assertEquals(mapped, pt.currentOffset(orig));
- }
-
- private void backwdCheck(PositionTracker pt, int orig, int mapped) {
- assertEquals(orig, pt.historicOffset(mapped));
- }
-
- private void doubleRangeCheck(PositionTracker pt, IRegion orig, IRegion mapped) {
- fwdRangeCheck(pt, orig, mapped);
- backwdRangeCheck(pt, orig, mapped);
- }
-
- private void fwdRangeCheck(PositionTracker pt, IRegion orig, IRegion mapped) {
- assertEquals(mapped, pt.historicToActual(orig));
- }
-
- private void backwdRangeCheck(PositionTracker pt, IRegion orig, IRegion mapped) {
- assertEquals(orig, pt.actualToHistoric(mapped));
- }
+ public static Test suite() {
+ return new TestSuite(PositionTrackerTests.class);
+ }
+
+ public void testInitialFailures() {
+ int[][] moves = {
+ { 46, -18, 95, -76, 98, -89, 10, -10, 85, -80, 16, 6, 5, -3, 22, -8, 29, -20, 86, -62, 34, -21, 63, -41,
+ 9, 10, 18, -7 },
+ { 0, 2, 1, -4 }, { 4, -1, 0, 2, 0, -5 }, { 0, 1, 2, 1, 0, -5 }, { 0, 1, 2, -3, 1, -4 },
+ { 4, 3, 3, -2, 0, -1 }, { 4, -1, 3, 1, 2, -1 }, { 0, 1, 2, 8, 1, -8, 0, -10 },
+ { 4, -1, 2, 1, 4, 1, 0, -1, 0, -5 }, };
+ int[] buffer = new int[100];
+ for (int i = 0; i < moves.length; i++) {
+ testMove(buffer, moves[i]);
+ }
+ }
+
+ public void testRotations() {
+ int[][] moves = { { 0, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 1, 12, 1, 14, 1, 16, 1, 18, 1, 20, 1, 22, 1, 24, 1 },
+ { 15, 1, 14, 1, 13, 1, 12, 1, 11, 1, 10, 1, 9, 1, 8, 1, 7, 1, 6, 1, 5, 1, 4, 1, 3, 1 },
+ { 0, 1, 10, 1, 2, 1, 20, 1, 4, 1, 20, 1, 6, 1, 20, 1, 8, 1, 20, 1, 10, 1, 20, 1, 12, 1 }, };
+ int[] buffer = new int[30];
+ for (int i = 0; i < moves.length; i++) {
+ assertTrue(testMove(buffer, moves[i]).depth() <= 5);
+ }
+ }
+
+ public void testDepth4() {
+ fullTest(5, 4);
+ }
+
+ public void testRandomDepth5() {
+ randomTest(20, 5, 5, 1000);
+ }
+
+ public void testRandomDepth10() {
+ randomTest(50, 10, 10, 1000);
+ }
+
+ public void testRandomDepth15() {
+ randomTest(100, 15, 15, 1000);
+ }
+
+ public void testRandomDepth20() {
+ randomTest(100, 15, 20, 1000);
+ }
+
+ public void testRetireDepth2() {
+ randomRetireTest(100, 10, 25, 2, 1000);
+ }
+
+ public void testRetireDepth5() {
+ randomRetireTest(100, 10, 10, 5, 1000);
+ }
+
+ public void testRetireDepth10() {
+ randomRetireTest(100, 10, 5, 10, 1000);
+ }
+
+ public static void fullTest(int len, int depth) {
+ // init buffer
+ int[] buffer = new int[len];
+ int[] move = new int[2 * depth];
+ for (int i = 0; i < move.length; i++) {
+ move[i] = -1;
+ }
+ while (nextMove(move, len)) {
+ testMove(buffer, move);
+ }
+ }
+
+ public static void randomTest(int buflen, int changelen, int depth, int count) {
+ // init buffer
+ Random rand = new Random();
+
+ int[] buffer = new int[buflen];
+ int[] move = new int[2 * depth];
+
+ for (int j = 0; j < count; j++) {
+ for (int i = 0; i < move.length; i += 2) {
+ move[i] = rand.nextInt(buflen);
+ move[i + 1] = rand.nextInt(2 * changelen) - changelen;
+ }
+ testMove(buffer, move);
+ }
+ }
+
+ public static void randomRetireTest(int buflen, int changelen, int depth, int trackerDepth, int count) {
+ // init buffer
+ Random rand = new Random();
+
+ int[] buffer = new int[buflen];
+ int[] move = new int[2 * depth];
+
+ for (int j = 0; j < count; j++) {
+ for (int i = 0; i < buffer.length; i++) {
+ buffer[i] = i;
+ }
+
+ PositionTracker t0 = null;
+ PositionTracker previous = null;
+ for (int t = 0; t < trackerDepth; t++) {
+ for (int i = 0; i < move.length; i += 2) {
+ move[i] = rand.nextInt(buflen);
+ move[i + 1] = rand.nextInt(2 * changelen) - changelen;
+ }
+ PositionTracker tracker = new PositionTracker();
+ if (previous != null) {
+ previous.retire(tracker);
+ }
+ doMove(buffer, move, tracker);
+ if (t0 == null) {
+ t0 = tracker;
+ }
+ previous = tracker;
+ }
+ check(t0, buffer);
+ }
+ }
+
+ static PositionTracker testMove(int[] buffer, int[] move) {
+ try {
+ return __testMove(buffer, move);
+ } catch (RuntimeException e) {
+ System.out.println("Error on move: "); //$NON-NLS-1$
+ for (int i = 0; i < move.length; i++) {
+ System.out.print(move[i] + ", "); //$NON-NLS-1$
+ }
+ System.out.println();
+ throw e;
+ } catch (Error e) {
+ System.out.println("Error on move: "); //$NON-NLS-1$
+ for (int i = 0; i < move.length; i++) {
+ System.out.print(move[i] + ", "); //$NON-NLS-1$
+ }
+ System.out.println();
+ throw e;
+ }
+ }
+
+ static PositionTracker __testMove(int[] buffer, int[] move) {
+ PositionTracker tracker = new PositionTracker();
+ for (int i = 0; i < buffer.length; i++) {
+ buffer[i] = i;
+ }
+ doMove(buffer, move, tracker);
+ check(tracker, buffer);
+ return tracker;
+ }
+
+ static void doMove(int[] buffer, int[] move, PositionTracker tracker) {
+ for (int i = 0; i < move.length; i += 2) {
+ int m1 = move[i];
+ int m2 = move[i + 1];
+ if (m1 == -1) {
+ break;
+ }
+ if (m2 > 0) {
+ tracker.insert(m1, m2);
+ for (int j = 0; j < buffer.length; j++) {
+ if (buffer[j] >= m1) {
+ buffer[j] += m2;
+ }
+ }
+ } else {
+ tracker.delete(m1, -m2);
+ int m3 = m1 - m2;
+ for (int j = 0; j < buffer.length; j++) {
+ if (buffer[j] >= m1) {
+ if (buffer[j] < m3) {
+ buffer[j] = -1;
+ } else {
+ buffer[j] += m2;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static void check(PositionTracker tracker, int[] buffer) {
+ int lasti2 = -1;
+ for (int i = 0; i < buffer.length; i++) {
+ int i2 = buffer[i];
+ if (i2 >= 0) {
+ int i22 = tracker.currentOffset(i);
+ assertEquals(i22, i2);
+ assertTrue(lasti2 < i22);
+ lasti2 = i22;
+
+ assertEquals(i, tracker.historicOffset(i2));
+ }
+ }
+ }
+
+ private static boolean nextMove(int[] move, int bufLen) {
+ for (int i = 0; i < move.length; i += 2) {
+ int m1 = move[i];
+ if (m1 < 0) {
+ move[i] = 0;
+ move[i + 1] = -bufLen;
+ return true;
+ }
+ int m2 = ++move[i + 1];
+ if (m2 <= bufLen - m1) {
+ return true;
+ }
+ if (m1 < bufLen - 1) {
+ move[i]++;
+ move[i + 1] = -bufLen + m1 + 1;
+ return true;
+ }
+ move[i] = 0;
+ move[i + 1] = -bufLen;
+ }
+ return false;
+ }
+
+ public void testInsertion() {
+ PositionTracker pt = new PositionTracker();
+ pt.insert(1, 1);
+
+ checkInsert11(pt);
+ }
+
+ private void checkInsert11(PositionTracker pt) {
+ // chars
+ doubleCheck(pt, 0, 0);
+ backwdCheck(pt, 1, 1);
+ doubleCheck(pt, 1, 2);
+ doubleCheck(pt, 2, 3);
+
+ // ranges
+ doubleRangeCheck(pt, new Region(0, 2), new Region(0, 3));
+ backwdRangeCheck(pt, new Region(0, 1), new Region(0, 2));
+ doubleRangeCheck(pt, new Region(0, 1), new Region(0, 1));
+ backwdRangeCheck(pt, new Region(1, 0), new Region(1, 1));
+ backwdRangeCheck(pt, new Region(1, 0), new Region(1, 0));
+ doubleRangeCheck(pt, new Region(1, 1), new Region(2, 1));
+ doubleRangeCheck(pt, new Region(1, 0), new Region(2, 0));
+ }
+
+ public void testDeletion() {
+ PositionTracker pt = new PositionTracker();
+ pt.delete(1, 1);
+ checkDelete11(pt);
+ }
+
+ private void checkDelete11(PositionTracker pt) {
+ doubleCheck(pt, 0, 0);
+ fwdCheck(pt, 1, 1);
+ doubleCheck(pt, 2, 1);
+ doubleCheck(pt, 3, 2);
+
+ // ranges
+ doubleRangeCheck(pt, new Region(0, 3), new Region(0, 2));
+ fwdRangeCheck(pt, new Region(0, 2), new Region(0, 1));
+ doubleRangeCheck(pt, new Region(0, 1), new Region(0, 1));
+ fwdRangeCheck(pt, new Region(1, 1), new Region(1, 0));
+ fwdRangeCheck(pt, new Region(1, 0), new Region(1, 0));
+ doubleRangeCheck(pt, new Region(2, 1), new Region(1, 1));
+ doubleRangeCheck(pt, new Region(2, 0), new Region(1, 0));
+ }
+
+ public void testReplace() {
+ PositionTracker pt = new PositionTracker();
+ pt.delete(1, 1);
+ pt.insert(1, 1);
+ doubleCheck(pt, 0, 0);
+ doubleCheck(pt, 1, 1);
+ doubleCheck(pt, 2, 2);
+ doubleCheck(pt, 3, 3);
+
+ pt.clear();
+ pt.insert(1, 1);
+ pt.delete(1, 1);
+ doubleCheck(pt, 0, 0);
+ doubleCheck(pt, 1, 1);
+ doubleCheck(pt, 2, 2);
+ doubleCheck(pt, 3, 3);
+
+ pt.clear();
+ pt.delete(0, 2);
+ pt.insert(0, 1);
+ checkDelete11(pt);
+
+ pt.clear();
+ pt.insert(1, 1);
+ pt.delete(1, 2);
+ checkDelete11(pt);
+
+ pt.clear();
+ pt.insert(1, 2);
+ pt.delete(1, 1);
+ checkInsert11(pt);
+
+ pt.clear();
+ pt.delete(1, 1);
+ pt.insert(1, 2);
+ checkInsert11(pt);
+ }
+
+ private void doubleCheck(PositionTracker pt, int orig, int mapped) {
+ fwdCheck(pt, orig, mapped);
+ backwdCheck(pt, orig, mapped);
+ }
+
+ private void fwdCheck(PositionTracker pt, int orig, int mapped) {
+ assertEquals(mapped, pt.currentOffset(orig));
+ }
+
+ private void backwdCheck(PositionTracker pt, int orig, int mapped) {
+ assertEquals(orig, pt.historicOffset(mapped));
+ }
+
+ private void doubleRangeCheck(PositionTracker pt, IRegion orig, IRegion mapped) {
+ fwdRangeCheck(pt, orig, mapped);
+ backwdRangeCheck(pt, orig, mapped);
+ }
+
+ private void fwdRangeCheck(PositionTracker pt, IRegion orig, IRegion mapped) {
+ assertEquals(mapped, pt.historicToActual(orig));
+ }
+
+ private void backwdRangeCheck(PositionTracker pt, IRegion orig, IRegion mapped) {
+ assertEquals(orig, pt.actualToHistoric(mapped));
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java
index 52eeb714ef1..cdf539f90c8 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/ResourceLookupTests.java
@@ -11,7 +11,7 @@
* Contributors:
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.core.internal.tests;
import java.io.File;
@@ -35,43 +35,44 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
public class ResourceLookupTests extends BaseTestCase {
- public static Test suite() {
- return new TestSuite(ResourceLookupTests.class);
- }
+ public static Test suite() {
+ return new TestSuite(ResourceLookupTests.class);
+ }
private IProject fProject;
- @Override
+ @Override
protected void setUp() throws Exception {
- super.setUp();
+ super.setUp();
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- fProject= root.getProject("reslookup_" + getName());
- }
-
- @Override
+ fProject = root.getProject("reslookup_" + getName());
+ }
+
+ @Override
protected void tearDown() throws Exception {
fProject.delete(true, new NullProgressMonitor());
super.tearDown();
- }
-
+ }
+
protected IFolder createFolder(IProject project, String filename) throws CoreException {
- IFolder folder= project.getFolder(filename);
+ IFolder folder = project.getFolder(filename);
folder.create(true, false, new NullProgressMonitor());
return folder;
}
protected IFile createFile(IProject project, String filename) throws CoreException {
- IFile file= project.getFile(filename);
+ IFile file = project.getFile(filename);
file.create(new InputStream() {
@Override
public int read() throws IOException {
return -1;
- }}, true, new NullProgressMonitor());
+ }
+ }, true, new NullProgressMonitor());
return file;
}
-
+
public void testNameLookup() throws CoreException {
- IProject[] prjs= new IProject[] { fProject };
+ IProject[] prjs = new IProject[] { fProject };
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
@@ -81,159 +82,159 @@ public class ResourceLookupTests extends BaseTestCase {
createFile(fProject, "folder1/abc.h");
createFile(fProject, "folder2/abC.h");
- IFile[] files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, false);
+ IFile[] files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, false);
assertEquals(2, files.length);
- files= ResourceLookup.findFilesByName(new Path("bla/../abc.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("bla/../abc.h"), prjs, false);
assertEquals(2, files.length);
- files= ResourceLookup.findFilesByName(new Path("../abc.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("../abc.h"), prjs, false);
assertEquals(2, files.length);
- files= ResourceLookup.findFilesByName(new Path("../../abc.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("../../abc.h"), prjs, false);
assertEquals(2, files.length);
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(3, files.length);
- files= ResourceLookup.findFilesByName(new Path("folder1/abc.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("folder1/abc.h"), prjs, false);
assertEquals(1, files.length);
- files= ResourceLookup.findFilesByName(new Path("folder1/abC.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("folder1/abC.h"), prjs, false);
assertEquals(0, files.length);
- files= ResourceLookup.findFilesByName(new Path("fOlder1/abc.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("fOlder1/abc.h"), prjs, false);
assertEquals(0, files.length);
- files= ResourceLookup.findFilesByName(new Path("folder1/abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("folder1/abc.h"), prjs, true);
assertEquals(1, files.length);
- files= ResourceLookup.findFilesByName(new Path("folder1/abC.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("folder1/abC.h"), prjs, true);
assertEquals(1, files.length);
- files= ResourceLookup.findFilesByName(new Path("fOlder1/abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("fOlder1/abc.h"), prjs, true);
assertEquals(1, files.length);
- files= ResourceLookup.findFilesByName(new Path("bla/../abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("bla/../abc.h"), prjs, true);
assertEquals(3, files.length);
}
public void testResourceDelta() throws CoreException {
- IProject[] prjs= new IProject[]{fProject};
+ IProject[] prjs = new IProject[] { fProject };
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
- IFile[] files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ IFile[] files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(0, files.length);
- IFolder f1= createFolder(fProject, "folder1");
+ IFolder f1 = createFolder(fProject, "folder1");
createFolder(fProject, "folder2");
- IFile f2= createFile(fProject, "abc.h");
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ IFile f2 = createFile(fProject, "abc.h");
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(1, files.length);
createFile(fProject, "folder1/abc.h");
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(2, files.length);
createFile(fProject, "folder2/abC.h");
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(3, files.length);
-
+
f1.delete(true, new NullProgressMonitor());
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(2, files.length);
-
+
f2.delete(true, new NullProgressMonitor());
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(1, files.length);
}
public void testDeref() throws CoreException {
- IProject[] prjs= new IProject[]{fProject};
+ IProject[] prjs = new IProject[] { fProject };
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
createFolder(fProject, "folder1");
createFolder(fProject, "folder2");
createFile(fProject, "abc.h");
- IFile[] files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ IFile[] files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(1, files.length);
-
+
ResourceLookup.unrefNodeMap();
createFile(fProject, "folder1/abc.h");
createFile(fProject, "folder2/abC.h");
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(3, files.length);
-
+
ResourceLookup.unrefNodeMap();
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
- assertEquals(3, files.length);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ assertEquals(3, files.length);
}
-
+
public void testCollected() throws CoreException {
- IProject[] prjs= new IProject[]{fProject};
+ IProject[] prjs = new IProject[] { fProject };
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
createFolder(fProject, "folder1");
createFolder(fProject, "folder2");
createFile(fProject, "abc.h");
- IFile[] files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ IFile[] files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(1, files.length);
-
+
ResourceLookup.simulateNodeMapCollection();
createFile(fProject, "folder1/abc.h");
createFile(fProject, "folder2/abC.h");
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
assertEquals(3, files.length);
-
+
ResourceLookup.simulateNodeMapCollection();
- files= ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
- assertEquals(3, files.length);
+ files = ResourceLookup.findFilesByName(new Path("abc.h"), prjs, true);
+ assertEquals(3, files.length);
}
-
+
public void testFindFilesByLocation() throws Exception {
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
createFolder(fProject, "folder1");
createFolder(fProject, "folder2");
- IFile file= createFile(fProject, "abc.h");
+ IFile file = createFile(fProject, "abc.h");
createFile(fProject, "folder1/abc.h");
createFile(fProject, "folder2/abC.h");
- URI uri= file.getLocationURI();
- IPath path= file.getLocation();
- IFile[] files= ResourceLookup.findFilesForLocationURI(uri);
+ URI uri = file.getLocationURI();
+ IPath path = file.getLocation();
+ IFile[] files = ResourceLookup.findFilesForLocationURI(uri);
assertEquals(1, files.length);
- files= ResourceLookup.findFilesForLocation(path);
+ files = ResourceLookup.findFilesForLocation(path);
assertEquals(1, files.length);
if (new File("a").equals(new File("A"))) {
- URI upperCase= new URI(uri.getScheme(), uri.getSchemeSpecificPart().toUpperCase(), uri.getFragment());
- IPath upperCasePath= new Path(path.toString().toUpperCase());
- files= ResourceLookup.findFilesForLocationURI(upperCase);
+ URI upperCase = new URI(uri.getScheme(), uri.getSchemeSpecificPart().toUpperCase(), uri.getFragment());
+ IPath upperCasePath = new Path(path.toString().toUpperCase());
+ files = ResourceLookup.findFilesForLocationURI(upperCase);
assertEquals(1, files.length);
- files= ResourceLookup.findFilesForLocation(upperCasePath);
+ files = ResourceLookup.findFilesForLocation(upperCasePath);
assertEquals(1, files.length);
- }
+ }
}
-
+
public void testLinkedResourceFiles() throws Exception {
- IProject[] prjs= new IProject[]{fProject};
+ IProject[] prjs = new IProject[] { fProject };
fProject.create(new NullProgressMonitor());
fProject.open(new NullProgressMonitor());
createFolder(fProject, "folder1");
- File f= createTempFile("extern", ".h");
- IPath location= Path.fromOSString(f.getAbsolutePath());
- IFile file1= fProject.getFile("linked1");
- IFile file2= fProject.getFile("linked2.h");
+ File f = createTempFile("extern", ".h");
+ IPath location = Path.fromOSString(f.getAbsolutePath());
+ IFile file1 = fProject.getFile("linked1");
+ IFile file2 = fProject.getFile("linked2.h");
file1.createLink(location, 0, new NullProgressMonitor());
file2.createLink(location, 0, new NullProgressMonitor());
IFile[] files = ResourceLookup.findFilesForLocation(location);
assertEquals(2, files.length);
-
- files= ResourceLookup.findFilesByName(new Path(location.lastSegment()), prjs, false);
+
+ files = ResourceLookup.findFilesByName(new Path(location.lastSegment()), prjs, false);
assertEquals(2, files.length);
- files= ResourceLookup.findFilesByName(new Path("linked2.h"), prjs, false);
+ files = ResourceLookup.findFilesByName(new Path("linked2.h"), prjs, false);
assertEquals(0, files.length);
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/StringBuilderTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/StringBuilderTest.java
index 70146edc266..012ae0b2d5d 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/StringBuilderTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/StringBuilderTest.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.core.internal.tests;
@@ -21,39 +21,38 @@ import junit.framework.TestCase;
import junit.framework.TestSuite;
public class StringBuilderTest extends TestCase {
- public static Test suite() {
- return new TestSuite(StringBuilderTest.class);
- }
+ public static Test suite() {
+ return new TestSuite(StringBuilderTest.class);
+ }
- public void testSafe() {
- StringBuilder b1= new StringBuilder();
- StringBuilder b2= new StringBuilder();
- b1.append("a");
- b2.append("b");
- CharSequence cs= b2;
- b1.append(cs);
- assertEquals("ab", b1.toString());
- }
-
- public void testBug220158() {
- StringBuilder b1= new StringBuilder();
- StringBuilder b2= new StringBuilder();
- b1.append("a");
- b2.append("b");
- b1.append(b2);
- assertEquals("ab", b1.toString());
- }
-
- public void testStringBuilderMethods() throws Exception {
- Class clazz= StringBuilder.class;
- Method method= clazz.getMethod("append", CharSequence.class);
+ public void testSafe() {
+ StringBuilder b1 = new StringBuilder();
+ StringBuilder b2 = new StringBuilder();
+ b1.append("a");
+ b2.append("b");
+ CharSequence cs = b2;
+ b1.append(cs);
+ assertEquals("ab", b1.toString());
+ }
+
+ public void testBug220158() {
+ StringBuilder b1 = new StringBuilder();
+ StringBuilder b2 = new StringBuilder();
+ b1.append("a");
+ b2.append("b");
+ b1.append(b2);
+ assertEquals("ab", b1.toString());
+ }
+
+ public void testStringBuilderMethods() throws Exception {
+ Class clazz = StringBuilder.class;
+ Method method = clazz.getMethod("append", CharSequence.class);
assertNotNull(method);
- try {
- method= clazz.getMethod("append", StringBuilder.class);
- fail();
- }
- catch (NoSuchMethodException m) {
- // ok
- }
- }
+ try {
+ method = clazz.getMethod("append", StringBuilder.class);
+ fail();
+ } catch (NoSuchMethodException m) {
+ // ok
+ }
+ }
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java
index bf72a753c69..069bd36670b 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryEFSExtensionProvider.java
@@ -24,12 +24,12 @@ import org.eclipse.cdt.core.EFSExtensionProvider;
public class MemoryEFSExtensionProvider extends EFSExtensionProvider {
public String getMappedPath(URI locationURI) {
-
+
String path = locationURI.getPath();
if (path.contains("/BeingMappedFrom/Folder")) {
return path.replaceFirst("/BeingMappedFrom/Folder", "/LocallyMappedTo/Folder");
}
-
+
return super.getMappedPath(locationURI);
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileStore.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileStore.java
index b6a97a74c7d..bbe8c1112dd 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileStore.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileStore.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Andrew Gvozdev (Quoin Inc.) - contributed to CDT from org.eclipse.core.tests.resources v20090320
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileSystem.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileSystem.java
index 35967e30dbf..7b2e4b56e19 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileSystem.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryFileSystem.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Andrew Gvozdev (Quoin Inc.) - contributed to CDT from org.eclipse.core.tests.resources v20090320
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryTree.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryTree.java
index 62eb70d91ab..39a3904e97e 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryTree.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/MemoryTree.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Andrew Gvozdev (Quoin Inc.) - contributed to CDT from org.eclipse.core.tests.resources v20090320
@@ -165,7 +165,8 @@ public class MemoryTree {
}
}
- static final int[] ALL_ATTRIBUTES = new int[] {EFS.ATTRIBUTE_ARCHIVE, EFS.ATTRIBUTE_EXECUTABLE, EFS.ATTRIBUTE_HIDDEN, EFS.ATTRIBUTE_READ_ONLY,};
+ static final int[] ALL_ATTRIBUTES = new int[] { EFS.ATTRIBUTE_ARCHIVE, EFS.ATTRIBUTE_EXECUTABLE,
+ EFS.ATTRIBUTE_HIDDEN, EFS.ATTRIBUTE_READ_ONLY, };
public static final MemoryTree TREE = new MemoryTree();
@@ -218,7 +219,7 @@ public class MemoryTree {
/**
* Returns the node at the given path, or null if not found.
- *
+ *
* @param path
* @return
*/
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/Policy.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/Policy.java
index 72e2d2eddbc..341f4d33f05 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/Policy.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/tests/filesystem/ram/Policy.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Andrew Gvozdev (Quoin Inc.) - contributed to CDT from org.eclipse.core.tests.resources v20090320
@@ -17,12 +17,13 @@ package org.eclipse.cdt.core.internal.tests.filesystem.ram;
import org.eclipse.core.runtime.*;
/**
- *
+ *
*/
public class Policy {
public static void error(String message) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.cdt.core.tests.internal.filesystem.ram", 1, message, null));
+ throw new CoreException(
+ new Status(IStatus.ERROR, "org.eclipse.cdt.core.tests.internal.filesystem.ram", 1, message, null));
}
private Policy() {
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/preferences/tests/TestScopeOfBuildConfigResourceChangesPreference.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/preferences/tests/TestScopeOfBuildConfigResourceChangesPreference.java
index 1f7679c77e4..8d681ce381d 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/preferences/tests/TestScopeOfBuildConfigResourceChangesPreference.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/preferences/tests/TestScopeOfBuildConfigResourceChangesPreference.java
@@ -36,9 +36,9 @@ public class TestScopeOfBuildConfigResourceChangesPreference extends TestCase {
private boolean oldInstanceScopeValue;
private boolean oldDefaultScopeValue;
- public static Test suite() {
- return new TestSuite(TestScopeOfBuildConfigResourceChangesPreference.class);
- }
+ public static Test suite() {
+ return new TestSuite(TestScopeOfBuildConfigResourceChangesPreference.class);
+ }
@Override
protected void setUp() throws Exception {
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java
index abfa6f3a9fa..a0e4d6e28c0 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/RefreshScopeTests.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -54,7 +54,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
*
*/
public class RefreshScopeTests extends TestCase {
-
+
private IProject fProject;
private IProject fGeneralProject;
private IFolder fFolder1;
@@ -63,44 +63,44 @@ public class RefreshScopeTests extends TestCase {
private IFolder fFolder4;
private IFolder fFolder5;
private IFolder fFolder6;
- private String config1,config2;
+ private String config1, config2;
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
-
+
// create project
CTestPlugin.getWorkspace().run(new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
- ICProject cProject = CProjectHelper.createNewStyleCProject("testRefreshScope", IPDOMManager.ID_NO_INDEXER, false);
+ ICProject cProject = CProjectHelper.createNewStyleCProject("testRefreshScope",
+ IPDOMManager.ID_NO_INDEXER, false);
fProject = cProject.getProject();
-
+
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
fGeneralProject = root.getProject("testRefreshScopeGeneral");
assertNotNull(fGeneralProject);
-
+
if (!fGeneralProject.exists()) {
fGeneralProject.create(null);
} else {
fGeneralProject.refreshLocal(IResource.DEPTH_INFINITE, null);
}
-
+
if (!fGeneralProject.isOpen()) {
fGeneralProject.open(null);
}
}
}, null);
-
-
+
IWorkspaceRoot root = CTestPlugin.getWorkspace().getRoot();
IProject project = root.getProject("testRefreshScope");
-
+
config1 = "Debug";
config2 = "Release";
-
+
// create some folders
// structure is:
/*
@@ -111,12 +111,12 @@ public class RefreshScopeTests extends TestCase {
* folder 4
* folder 5
* folder 6
- *
+ *
*/
final IFolder folder1 = project.getFolder("folder1");
fFolder1 = folder1;
final IFolder folder2 = project.getFolder("folder2");
- fFolder2 = folder2;
+ fFolder2 = folder2;
final IFolder folder3 = folder2.getFolder("folder3");
fFolder3 = folder3;
final IFolder folder4 = folder3.getFolder("folder4");
@@ -125,11 +125,11 @@ public class RefreshScopeTests extends TestCase {
fFolder5 = folder5;
final IFolder folder6 = folder2.getFolder("folder6");
fFolder6 = folder6;
-
+
CTestPlugin.getWorkspace().run(new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
-
+
folder1.create(true, true, monitor);
folder2.create(true, true, monitor);
folder3.create(true, true, monitor);
@@ -138,7 +138,7 @@ public class RefreshScopeTests extends TestCase {
folder6.create(true, true, monitor);
}
}, null);
-
+
}
/* (non-Javadoc)
@@ -148,13 +148,13 @@ public class RefreshScopeTests extends TestCase {
protected void tearDown() throws Exception {
fProject.delete(true, true, null);
}
-
+
public void testAddDeleteResource() throws CoreException {
-
+
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
- // TEST 1:
+
+ // TEST 1:
// add resource "folder1" under config1.
manager.addResourceToRefresh(fProject, config1, fFolder1);
// now, check that it was added.
@@ -162,7 +162,7 @@ public class RefreshScopeTests extends TestCase {
assertEquals(config1_resources.size(), 2);
assertEquals(config1_resources.contains(fProject), true);
assertEquals(config1_resources.contains(fFolder1), true);
-
+
// TEST 2:
// add resource "folder2" under config1
manager.addResourceToRefresh(fProject, config1, fFolder2);
@@ -172,19 +172,19 @@ public class RefreshScopeTests extends TestCase {
assertEquals(config1_resources.contains(fProject), true);
assertEquals(config1_resources.contains(fFolder1), true);
assertEquals(config1_resources.contains(fFolder2), true);
-
+
// make sure it wasn't added under "Release", which should be empty now, excpet for the default project resource.
List<IResource> config2_resources = manager.getResourcesToRefresh(fProject, config2);
- assertEquals(config2_resources.size(),1);
+ assertEquals(config2_resources.size(), 1);
assertEquals(config2_resources.contains(fProject), true);
-
+
// and add one under config 2.
manager.addResourceToRefresh(fProject, config2, fFolder1);
config2_resources = manager.getResourcesToRefresh(fProject, config2);
- assertEquals(config2_resources.size(),2);
+ assertEquals(config2_resources.size(), 2);
assertEquals(config2_resources.contains(fProject), true);
assertEquals(config2_resources.contains(fFolder1), true);
-
+
// TEST 3:
// first try deleting a resource that was never added... folder5
manager.deleteResourceToRefresh(fProject, config1, fFolder5);
@@ -192,16 +192,15 @@ public class RefreshScopeTests extends TestCase {
assertEquals(config1_resourcesAfterDelete.size(), 3);
assertEquals(config1_resources.contains(fProject), true);
assertEquals(config1_resources.contains(fFolder1), true);
- assertEquals( config1_resources.contains(fFolder2), true);
-
+ assertEquals(config1_resources.contains(fFolder2), true);
+
// ditto for config2, but this time we did add the resource, to make sure fFolder1 wasn't added.
manager.deleteResourceToRefresh(fProject, config2, fFolder5);
List<IResource> config2_resourcesAfterDelete = manager.getResourcesToRefresh(fProject, config2);
assertEquals(config2_resourcesAfterDelete.size(), 2);
assertEquals(config2_resources.contains(fProject), true);
assertEquals(config2_resources.contains(fFolder1), true);
-
-
+
// TEST 4:
// now delete the resources from the manager one by one
manager.deleteResourceToRefresh(fProject, config1, config1_resources.get(config1_resources.indexOf(fFolder2)));
@@ -209,90 +208,88 @@ public class RefreshScopeTests extends TestCase {
assertEquals(config1_resourcesAfterDelete.size(), 2);
assertEquals(config1_resourcesAfterDelete.contains(fProject), true);
assertEquals(config1_resourcesAfterDelete.contains(fFolder1), true);
-
- manager.deleteResourceToRefresh(fProject, config1, config1_resources.get(config1_resources.indexOf(fFolder1)));
+
+ manager.deleteResourceToRefresh(fProject, config1, config1_resources.get(config1_resources.indexOf(fFolder1)));
config1_resourcesAfterDelete = manager.getResourcesToRefresh(fProject, config1);
assertEquals(config1_resourcesAfterDelete.size(), 1);
assertEquals(config1_resourcesAfterDelete.contains(fProject), true);
-
+
// and ditto for config2
manager.deleteResourceToRefresh(fProject, config2, config2_resources.get(config2_resources.indexOf(fFolder1)));
config2_resourcesAfterDelete = manager.getResourcesToRefresh(fProject, config2);
- assertEquals(config2_resourcesAfterDelete.size(), 1);
+ assertEquals(config2_resourcesAfterDelete.size(), 1);
assertEquals(config2_resourcesAfterDelete.contains(fProject), true);
}
-
public void testSetResourcesToExclusionsMapRefresh() {
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
HashMap<IResource, List<RefreshExclusion>> config1_resourceMap = new HashMap<IResource, List<RefreshExclusion>>();
- config1_resourceMap.put(fFolder1,new LinkedList<RefreshExclusion>());
- config1_resourceMap.put(fFolder2,new LinkedList<RefreshExclusion>());
+ config1_resourceMap.put(fFolder1, new LinkedList<RefreshExclusion>());
+ config1_resourceMap.put(fFolder2, new LinkedList<RefreshExclusion>());
manager.setResourcesToExclusionsMap(fProject, config1, config1_resourceMap);
-
+
List<IResource> config1_resourcesAfterSet = manager.getResourcesToRefresh(fProject, config1);
assertEquals(config1_resourcesAfterSet.size(), 2);
assertEquals(config1_resourcesAfterSet.contains(fFolder1), true);
assertEquals(config1_resourcesAfterSet.contains(fFolder2), true);
-
+
manager.clearResourcesToRefresh(fProject);
-
+
}
-
+
public void testAddRemoveExclusion() {
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
IResource config1_resource = fProject;
-
-
+
manager.addResourceToRefresh(fProject, config1, config1_resource);
RefreshExclusion config1_exclusion1 = new TestExclusion();
manager.addExclusion(fProject, config1, config1_resource, config1_exclusion1);
RefreshExclusion config1_exclusion2 = new TestExclusion();
manager.addExclusion(fProject, config1, config1_resource, config1_exclusion2);
-
+
// make sure the exclusions are there
List<RefreshExclusion> exclusionsList = manager.getExclusions(fProject, config1, config1_resource);
RefreshExclusion[] exclusionsArray = exclusionsList.toArray(new RefreshExclusion[0]);
assertEquals(exclusionsArray.length, 2);
assertEquals(exclusionsArray[0], config1_exclusion1);
assertEquals(exclusionsArray[1], config1_exclusion2);
-
+
// remove the exclusions one by one
manager.removeExclusion(fProject, config1, config1_resource, config1_exclusion2);
- exclusionsList = manager.getExclusions(fProject,config1,config1_resource);
+ exclusionsList = manager.getExclusions(fProject, config1, config1_resource);
exclusionsArray = exclusionsList.toArray(new RefreshExclusion[0]);
assertEquals(exclusionsArray.length, 1);
assertEquals(exclusionsArray[0], config1_exclusion1);
-
+
manager.removeExclusion(fProject, config1, config1_resource, config1_exclusion1);
- exclusionsList = manager.getExclusions(fProject, config1,config1_resource);
+ exclusionsList = manager.getExclusions(fProject, config1, config1_resource);
exclusionsArray = exclusionsList.toArray(new RefreshExclusion[0]);
assertEquals(exclusionsArray.length, 0);
-
+
}
-
+
public void testPersistAndLoad() {
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
IResource config1_resource = fProject;
IResource config2_resource = fFolder1;
-
+
//add a resource and two exclusions for config1.
- manager.addResourceToRefresh(fProject, config1, config1_resource);
+ manager.addResourceToRefresh(fProject, config1, config1_resource);
RefreshExclusion config1_exclusion1 = new TestExclusion();
manager.addExclusion(fProject, config1, config1_resource, config1_exclusion1);
RefreshExclusion config1_exclusion2 = new TestExclusion();
manager.addExclusion(fProject, config1, config1_resource, config1_exclusion2);
-
+
// add a nested exclusion to the first exclusion
RefreshExclusion config1_exclusion3 = new TestExclusion();
config1_exclusion1.addNestedExclusion(config1_exclusion3);
-
+
// add an instance to the second exclusion
ExclusionInstance config1_instance = new ExclusionInstance();
config1_instance.setDisplayString("foo");
@@ -300,18 +297,18 @@ public class RefreshScopeTests extends TestCase {
config1_instance.setExclusionType(ExclusionType.RESOURCE);
config1_instance.setParentExclusion(config1_exclusion2);
config1_exclusion2.addExclusionInstance(config1_instance);
-
+
//add a resource and two exclusions for config2.
- manager.addResourceToRefresh(fProject, config2, config2_resource);
+ manager.addResourceToRefresh(fProject, config2, config2_resource);
RefreshExclusion config2_exclusion1 = new TestExclusion();
manager.addExclusion(fProject, config2, config2_resource, config2_exclusion1);
RefreshExclusion config2_exclusion2 = new TestExclusion();
manager.addExclusion(fProject, config2, config2_resource, config2_exclusion2);
-
+
// add a nested exclusion to the first exclusion
RefreshExclusion config2_exclusion3 = new TestExclusion();
config2_exclusion1.addNestedExclusion(config2_exclusion3);
-
+
// add an instance to the second exclusion
ExclusionInstance config2_instance = new ExclusionInstance();
config2_instance.setDisplayString("foo");
@@ -319,120 +316,118 @@ public class RefreshScopeTests extends TestCase {
config2_instance.setExclusionType(ExclusionType.RESOURCE);
config2_instance.setParentExclusion(config2_exclusion2);
config2_exclusion2.addExclusionInstance(config1_instance);
-
+
ICProjectDescription projectDescription = CCorePlugin.getDefault().getProjectDescription(fProject, true);
-
+
try {
manager.persistSettings(projectDescription);
CCorePlugin.getDefault().setProjectDescription(fProject, projectDescription);
} catch (CoreException e) {
fail();
}
-
+
// now clear all the settings out of the manager
manager.clearAllData();
-
+
// now load the settings
try {
manager.loadSettings();
} catch (CoreException e) {
fail();
}
-
+
// make sure we got the same stuff we saved for config1
-
+
// the project should be set to refresh its root
- List<IResource> config1_resources = manager.getResourcesToRefresh(fProject,config1);
+ List<IResource> config1_resources = manager.getResourcesToRefresh(fProject, config1);
assertEquals(config1_resources.size(), 1);
assertEquals(config1_resources.toArray(new IResource[0])[0], config1_resource);
-
+
// there should be 2 top-level exclusions
- List<RefreshExclusion> config1_exclusions = manager.getExclusions(fProject, config1,config1_resource);
+ List<RefreshExclusion> config1_exclusions = manager.getExclusions(fProject, config1, config1_resource);
assertEquals(2, config1_exclusions.size());
RefreshExclusion[] config1_exclusionsArray = config1_exclusions.toArray(new RefreshExclusion[0]);
-
+
// both exclusions should have parent resource set to the project
assertEquals(config1_resource, config1_exclusionsArray[0].getParentResource());
assertEquals(config1_resource, config1_exclusionsArray[1].getParentResource());
-
+
// the first exclusion should have one nested exclusion
List<RefreshExclusion> config1_nestedExclusions1 = config1_exclusionsArray[0].getNestedExclusions();
assertEquals(config1_nestedExclusions1.size(), 1);
- RefreshExclusion[] config1_nestedExclusionsArray = config1_nestedExclusions1.toArray(new RefreshExclusion[0]);
+ RefreshExclusion[] config1_nestedExclusionsArray = config1_nestedExclusions1.toArray(new RefreshExclusion[0]);
// the nested exclusion should have its parent exclusion set properly
assertEquals(config1_nestedExclusionsArray[0].getParentExclusion(), config1_exclusionsArray[0]);
-
+
// the second exclusion should have no nested exclusions
List<RefreshExclusion> config1_nestedExclusions2 = config1_exclusionsArray[1].getNestedExclusions();
assertEquals(config1_nestedExclusions2.size(), 0);
-
+
// the second exclusion should have an instance
List<ExclusionInstance> config1_instances = config1_exclusionsArray[1].getExclusionInstances();
assertEquals(1, config1_instances.size());
ExclusionInstance[] config1_instancesArray = config1_instances.toArray(new ExclusionInstance[0]);
ExclusionInstance config1_loadedInstance = config1_instancesArray[0];
-
+
// check the contents of the instance
assertEquals("foo", config1_loadedInstance.getDisplayString());
assertEquals(fFolder2, config1_loadedInstance.getResource());
assertEquals(ExclusionType.RESOURCE, config1_loadedInstance.getExclusionType());
-
+
// clear data for config1
manager.deleteResourceToRefresh(fProject, config1, config1_resource);
-
+
// make sure we got the same stuff we saved for config2
// the project should be set to refresh its root
- List<IResource> config2_resources = manager.getResourcesToRefresh(fProject,config2);
+ List<IResource> config2_resources = manager.getResourcesToRefresh(fProject, config2);
assertEquals(config2_resources.size(), 2);
assertEquals(config2_resources.contains(config2_resource), true);
-
+
// there should be 2 top-level exclusions
- List<RefreshExclusion> config2_exclusions = manager.getExclusions(fProject,config2,config2_resource);
+ List<RefreshExclusion> config2_exclusions = manager.getExclusions(fProject, config2, config2_resource);
assertEquals(2, config2_exclusions.size());
RefreshExclusion[] config2_exclusionsArray = config2_exclusions.toArray(new RefreshExclusion[0]);
-
+
// both exclusions should have parent resource set to the project
assertEquals(config2_resource, config2_exclusionsArray[0].getParentResource());
assertEquals(config2_resource, config2_exclusionsArray[1].getParentResource());
-
+
// the first exclusion should have one nested exclusion
List<RefreshExclusion> config2_nestedExclusions1 = config2_exclusionsArray[0].getNestedExclusions();
assertEquals(config2_nestedExclusions1.size(), 1);
- RefreshExclusion[] config2_nestedExclusionsArray = config2_nestedExclusions1.toArray(new RefreshExclusion[0]);
+ RefreshExclusion[] config2_nestedExclusionsArray = config2_nestedExclusions1.toArray(new RefreshExclusion[0]);
// the nested exclusion should have its parent exclusion set properly
assertEquals(config2_nestedExclusionsArray[0].getParentExclusion(), config2_exclusionsArray[0]);
-
+
// the second exclusion should have no nested exclusions
List<RefreshExclusion> config2_nestedExclusions2 = config2_exclusionsArray[1].getNestedExclusions();
assertEquals(config2_nestedExclusions2.size(), 0);
-
+
// the second exclusion should have an instance
List<ExclusionInstance> config2_instances = config2_exclusionsArray[1].getExclusionInstances();
assertEquals(1, config2_instances.size());
ExclusionInstance[] config2_instancesArray = config2_instances.toArray(new ExclusionInstance[0]);
ExclusionInstance config2_loadedInstance = config2_instancesArray[0];
-
+
// check the contents of the instance
assertEquals("foo", config2_loadedInstance.getDisplayString());
assertEquals(fFolder2, config2_loadedInstance.getResource());
assertEquals(ExclusionType.RESOURCE, config2_loadedInstance.getExclusionType());
-
+
// cleanup
manager.clearAllData();
}
-
public void testResourceExclusion() {
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
IResource config1_resource = fProject;
-
-
+
String conf_name = getCurrentConfigName();
-
+
manager.addResourceToRefresh(fProject, conf_name, config1_resource);
-
+
// create a series of nested exclusions that include/exclude certain folders
// will be included/excluded as follows
/*
@@ -443,9 +438,9 @@ public class RefreshScopeTests extends TestCase {
* folder 4 - exclude
* folder 5 - include
* folder 6 - exclude
- *
+ *
*/
-
+
ResourceExclusion exclusion1 = new ResourceExclusion();
ExclusionInstance instance1 = new ExclusionInstance();
instance1.setResource(fFolder1);
@@ -454,21 +449,19 @@ public class RefreshScopeTests extends TestCase {
instance2.setResource(fFolder2);
exclusion1.addExclusionInstance(instance2);
manager.addExclusion(fProject, conf_name, config1_resource, exclusion1);
-
-
+
ResourceExclusion exclusion2 = new ResourceExclusion();
ExclusionInstance instance3 = new ExclusionInstance();
instance3.setResource(fFolder3);
exclusion2.addExclusionInstance(instance3);
exclusion1.addNestedExclusion(exclusion2);
-
+
ResourceExclusion exclusion3 = new ResourceExclusion();
ExclusionInstance instance4 = new ExclusionInstance();
instance4.setResource(fFolder4);
exclusion3.addExclusionInstance(instance4);
exclusion2.addNestedExclusion(exclusion3);
-
-
+
// now check and see if the right folders are included/excluded
assertEquals(true, manager.shouldResourceBeRefreshed(conf_name, config1_resource));
assertEquals(false, manager.shouldResourceBeRefreshed(conf_name, fFolder1));
@@ -477,32 +470,31 @@ public class RefreshScopeTests extends TestCase {
assertEquals(false, manager.shouldResourceBeRefreshed(conf_name, fFolder4));
assertEquals(true, manager.shouldResourceBeRefreshed(conf_name, fFolder5));
assertEquals(false, manager.shouldResourceBeRefreshed(conf_name, fFolder6));
-
-
+
// now let's create a bunch of files in these directories using java.io.File (so that we don't get
// resource deltas happening), and refresh the project according to the policy. We should only see the files
// in the same folders above when consulting the resource system
IPath path = fProject.getLocation();
createTestFile(path);
-
+
path = fFolder1.getLocation();
createTestFile(path);
-
+
path = fFolder2.getLocation();
createTestFile(path);
-
+
path = fFolder3.getLocation();
createTestFile(path);
-
+
path = fFolder4.getLocation();
createTestFile(path);
-
+
path = fFolder5.getLocation();
createTestFile(path);
-
+
path = fFolder6.getLocation();
createTestFile(path);
-
+
// now refresh
IWorkspaceRunnable runnable = manager.getRefreshRunnable(fProject, conf_name);
try {
@@ -510,7 +502,7 @@ public class RefreshScopeTests extends TestCase {
} catch (CoreException e) {
fail();
}
-
+
// check if the proper resources exist in the workspace
IResource resource = fProject.getFile("foo.cpp");
assertEquals(true, resource.exists());
@@ -526,7 +518,7 @@ public class RefreshScopeTests extends TestCase {
assertEquals(true, resource.exists());
resource = fFolder6.getFile("foo.cpp");
assertEquals(false, resource.exists());
-
+
manager.clearAllData();
}
@@ -539,54 +531,53 @@ public class RefreshScopeTests extends TestCase {
} catch (IOException e) {
fail();
}
-
}
-
+
public void testDefaults() {
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
// by default, a project should refresh its root
List<IResource> resourcesToRefresh = manager.getResourcesToRefresh(fProject, config1);
assertEquals(1, resourcesToRefresh.size());
assertEquals(resourcesToRefresh.contains(fProject), true);
-
+
// there should be no exclusions
List<RefreshExclusion> exclusions = manager.getExclusions(fProject, config1, fProject);
assertEquals(0, exclusions.size());
-
+
ICProjectDescription projectDescription = CCorePlugin.getDefault().getProjectDescription(fProject);
-
+
// now try persisting the data and loading it
try {
manager.persistSettings(projectDescription);
} catch (CoreException e) {
fail();
}
-
+
manager.clearAllData();
-
+
try {
manager.loadSettings();
} catch (CoreException e) {
fail();
}
-
+
// test the defaults again
// by default, a project should refresh its root
resourcesToRefresh = manager.getResourcesToRefresh(fProject, config1);
assertEquals(1, resourcesToRefresh.size());
assertEquals(resourcesToRefresh.contains(fProject), true);
-
+
// there should be no exclusions
exclusions = manager.getExclusions(fProject, config1, fProject);
assertEquals(0, exclusions.size());
-
+
}
public void closeProject(ICProjectDescription projDesc) {
-
+
try {
// save the project description
CCorePlugin.getDefault().setProjectDescription(fProject, projDesc);
@@ -595,41 +586,41 @@ public class RefreshScopeTests extends TestCase {
fail();
}
}
-
+
public void openProject() {
- try {
- fProject.open(null);
+ try {
+ fProject.open(null);
} catch (CoreException e) {
fail();
}
}
-
+
public String getCurrentConfigName() {
CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance();
ICProjectDescription projectDescription = descriptionManager.getProjectDescription(fProject, false);
ICConfigurationDescription conf = projectDescription.getActiveConfiguration();
return conf.getName();
}
-
+
public void testEmptyRefreshScopeCloseAndReopen() {
-
+
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
String config_name = getCurrentConfigName();
-
+
// get the resources. since we are not loading ... the project should auto-magically be added by default.
List<IResource> config_resources = manager.getResourcesToRefresh(fProject, config_name);
- assertEquals(1,config_resources.size());
+ assertEquals(1, config_resources.size());
assertEquals(true, config_resources.contains(fProject));
-
+
// now delete it.
manager.deleteResourceToRefresh(fProject, config_name, fProject);
-
+
// and make sure it is empty.
config_resources = manager.getResourcesToRefresh(fProject, config_name);
- assertEquals(0,config_resources.size());
-
+ assertEquals(0, config_resources.size());
+
// write the persistent data.
ICProjectDescription projectDescription = CCorePlugin.getDefault().getProjectDescription(fProject);
try {
@@ -637,34 +628,37 @@ public class RefreshScopeTests extends TestCase {
} catch (CoreException e) {
fail();
}
-
+
// close and reopen
- closeProject(projectDescription);
+ closeProject(projectDescription);
openProject();
-
+
// now verify that there are no resources.
- HashMap<String, HashMap<IResource, List<RefreshExclusion>>> config_map = manager.getConfigurationToResourcesMap(fProject);
- assertEquals(1,config_map.size());
+ HashMap<String, HashMap<IResource, List<RefreshExclusion>>> config_map = manager
+ .getConfigurationToResourcesMap(fProject);
+ assertEquals(1, config_map.size());
config_resources = manager.getResourcesToRefresh(fProject, config_name);
- assertEquals(0,config_resources.size());
+ assertEquals(0, config_resources.size());
}
-
+
public void testAddEmptyConfiguration() {
- final String CFG_NAME="empty_config";
-
+ final String CFG_NAME = "empty_config";
+
CoreModel model = CoreModel.getDefault();
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance();
ICProjectDescription projectDescription = descriptionManager.getProjectDescription(fProject, false);
ICConfigurationDescription base = projectDescription.getActiveConfiguration();
-
+
ICProjectDescription propertyProjectDescription = CoreModel.getDefault().getProjectDescription(fProject);
- ICConfigurationDescription propertyDefaultConfigurationDescription = propertyProjectDescription.getConfigurations()[0];
+ ICConfigurationDescription propertyDefaultConfigurationDescription = propertyProjectDescription
+ .getConfigurations()[0];
try {
projectDescription.setReadOnly(false, true);
- ICConfigurationDescription newCfg = projectDescription.createConfiguration(CFG_NAME + ".id", CFG_NAME, propertyDefaultConfigurationDescription);
+ ICConfigurationDescription newCfg = projectDescription.createConfiguration(CFG_NAME + ".id", CFG_NAME,
+ propertyDefaultConfigurationDescription);
} catch (WriteAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -673,31 +667,29 @@ public class RefreshScopeTests extends TestCase {
e.printStackTrace();
}
-
List<IResource> empty_config_resources = manager.getResourcesToRefresh(fProject, CFG_NAME);
- assertEquals(1,empty_config_resources.size());
- assertEquals(true,empty_config_resources.contains(fProject));
-
+ assertEquals(1, empty_config_resources.size());
+ assertEquals(true, empty_config_resources.contains(fProject));
+
}
-
+
public void testNullProjectDescription_bug387428() {
- final String CFG_NAME="empty_config";
-
+ final String CFG_NAME = "empty_config";
+
CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance();
ICProjectDescription projectDescription = descriptionManager.getProjectDescription(fGeneralProject, false);
assertNull(projectDescription);
-
+
RefreshScopeManager manager = RefreshScopeManager.getInstance();
manager.clearAllData();
-
+
List<IResource> empty_config_resources = manager.getResourcesToRefresh(fGeneralProject, CFG_NAME);
- assertEquals(1,empty_config_resources.size());
- assertEquals(true,empty_config_resources.contains(fGeneralProject));
+ assertEquals(1, empty_config_resources.size());
+ assertEquals(true, empty_config_resources.contains(fGeneralProject));
}
-
+
public static Test suite() {
return new TestSuite(RefreshScopeTests.class);
}
-
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusion.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusion.java
index d1393e5b21e..0402bb68387 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusion.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusion.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusionFactory.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusionFactory.java
index b00b53b78bf..7fc5dd75307 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusionFactory.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/resources/tests/TestExclusionFactory.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,7 +24,7 @@ import org.eclipse.cdt.core.resources.RefreshExclusionFactory;
public class TestExclusionFactory extends RefreshExclusionFactory {
/**
- *
+ *
*/
public TestExclusionFactory() {
// TODO Auto-generated constructor stub
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/winreg/tests/WinRegTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/winreg/tests/WinRegTests.java
index 3caefcf8ce9..b0c3d005b5c 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/winreg/tests/WinRegTests.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/winreg/tests/WinRegTests.java
@@ -24,7 +24,8 @@ public class WinRegTests extends TestCase {
WindowsRegistry registry = WindowsRegistry.getRegistry();
if (Platform.getOS().equals(Platform.OS_WIN32)) {
assertNotNull(registry);
- String value = registry.getLocalMachineValue("SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir");
+ String value = registry.getLocalMachineValue("SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
+ "ProgramFilesDir");
// Not sure how you set this to anything else so it seems safe.
assertEquals("C:\\Program Files", value);
} else {
@@ -32,7 +33,7 @@ public class WinRegTests extends TestCase {
assertNotNull(registry);
}
}
-
+
public void test2() {
WindowsRegistry registry = WindowsRegistry.getRegistry();
if (Platform.getOS().equals(Platform.OS_WIN32)) {
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/ByteUtilsTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/ByteUtilsTest.java
index 88ab4c421f3..2d735c6685f 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/ByteUtilsTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/ByteUtilsTest.java
@@ -29,123 +29,177 @@ public class ByteUtilsTest extends TestCase {
}
// Allows us to avoid ugly misalignment in the source
- private static byte Ox80 = (byte)0x80;
- private static byte Oxff = (byte)0xff;
-
+ private static byte Ox80 = (byte) 0x80;
+ private static byte Oxff = (byte) 0xff;
+
public void testMakeShort() throws Exception {
- Assert.assertEquals((short)0x0000, makeShort(new byte[]{0x00,0x00}, 0, false));
- Assert.assertEquals((short)0x7f00, makeShort(new byte[]{0x7f,0x00}, 0, false));
- Assert.assertEquals((short)0x007f, makeShort(new byte[]{0x00,0x7f}, 0, false));
- Assert.assertEquals((short)0x8000, makeShort(new byte[]{Ox80,0x00}, 0, false));
- Assert.assertEquals((short)0x0080, makeShort(new byte[]{0x00,Ox80}, 0, false));
- Assert.assertEquals((short)0xff00, makeShort(new byte[]{Oxff,0x00}, 0, false));
- Assert.assertEquals((short)0x00ff, makeShort(new byte[]{0x00,Oxff}, 0, false));
- Assert.assertEquals((short)0xffff, makeShort(new byte[]{Oxff,Oxff}, 0, false));
-
- Assert.assertEquals((short)0x0000, makeShort(new byte[]{0x00,0x00}, 0, true));
- Assert.assertEquals((short)0x007f, makeShort(new byte[]{0x7f,0x00}, 0, true));
- Assert.assertEquals((short)0x7f00, makeShort(new byte[]{0x00,0x7f}, 0, true));
- Assert.assertEquals((short)0x0080, makeShort(new byte[]{Ox80,0x00}, 0, true));
- Assert.assertEquals((short)0x8000, makeShort(new byte[]{0x00,Ox80}, 0, true));
- Assert.assertEquals((short)0x00ff, makeShort(new byte[]{Oxff,0x00}, 0, true));
- Assert.assertEquals((short)0xff00, makeShort(new byte[]{0x00,Oxff}, 0, true));
- Assert.assertEquals((short)0xffff, makeShort(new byte[]{Oxff,Oxff}, 0, true));
-
- Assert.assertEquals(0x0102, makeShort(new byte[]{0,0,0,0x01,0x02}, 3, false));
- Assert.assertEquals(0x0201, makeShort(new byte[]{0,0,0,0x01,0x02}, 3, true));
+ Assert.assertEquals((short) 0x0000, makeShort(new byte[] { 0x00, 0x00 }, 0, false));
+ Assert.assertEquals((short) 0x7f00, makeShort(new byte[] { 0x7f, 0x00 }, 0, false));
+ Assert.assertEquals((short) 0x007f, makeShort(new byte[] { 0x00, 0x7f }, 0, false));
+ Assert.assertEquals((short) 0x8000, makeShort(new byte[] { Ox80, 0x00 }, 0, false));
+ Assert.assertEquals((short) 0x0080, makeShort(new byte[] { 0x00, Ox80 }, 0, false));
+ Assert.assertEquals((short) 0xff00, makeShort(new byte[] { Oxff, 0x00 }, 0, false));
+ Assert.assertEquals((short) 0x00ff, makeShort(new byte[] { 0x00, Oxff }, 0, false));
+ Assert.assertEquals((short) 0xffff, makeShort(new byte[] { Oxff, Oxff }, 0, false));
+
+ Assert.assertEquals((short) 0x0000, makeShort(new byte[] { 0x00, 0x00 }, 0, true));
+ Assert.assertEquals((short) 0x007f, makeShort(new byte[] { 0x7f, 0x00 }, 0, true));
+ Assert.assertEquals((short) 0x7f00, makeShort(new byte[] { 0x00, 0x7f }, 0, true));
+ Assert.assertEquals((short) 0x0080, makeShort(new byte[] { Ox80, 0x00 }, 0, true));
+ Assert.assertEquals((short) 0x8000, makeShort(new byte[] { 0x00, Ox80 }, 0, true));
+ Assert.assertEquals((short) 0x00ff, makeShort(new byte[] { Oxff, 0x00 }, 0, true));
+ Assert.assertEquals((short) 0xff00, makeShort(new byte[] { 0x00, Oxff }, 0, true));
+ Assert.assertEquals((short) 0xffff, makeShort(new byte[] { Oxff, Oxff }, 0, true));
+
+ Assert.assertEquals(0x0102, makeShort(new byte[] { 0, 0, 0, 0x01, 0x02 }, 3, false));
+ Assert.assertEquals(0x0201, makeShort(new byte[] { 0, 0, 0, 0x01, 0x02 }, 3, true));
}
-
+
public void testMakeInt() throws Exception {
- Assert.assertEquals(0x00000000, makeInt(new byte[]{0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x7f000000, makeInt(new byte[]{0x7f,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x007f0000, makeInt(new byte[]{0x00,0x7f,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00007f00, makeInt(new byte[]{0x00,0x00,0x7f,0x00}, 0, false));
- Assert.assertEquals(0x0000007f, makeInt(new byte[]{0x00,0x00,0x00,0x7f}, 0, false));
- Assert.assertEquals(0x80000000, makeInt(new byte[]{Ox80,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00800000, makeInt(new byte[]{0x00,Ox80,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00008000, makeInt(new byte[]{0x00,0x00,Ox80,0x00}, 0, false));
- Assert.assertEquals(0x00000080, makeInt(new byte[]{0x00,0x00,0x00,Ox80}, 0, false));
- Assert.assertEquals(0xff000000, makeInt(new byte[]{Oxff,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00ff0000, makeInt(new byte[]{0x00,Oxff,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000ff00, makeInt(new byte[]{0x00,0x00,Oxff,0x00}, 0, false));
- Assert.assertEquals(0x000000ff, makeInt(new byte[]{0x00,0x00,0x00,Oxff}, 0, false));
- Assert.assertEquals(0xffffffff, makeInt(new byte[]{Oxff,Oxff,Oxff,Oxff}, 0, false));
+ Assert.assertEquals(0x00000000, makeInt(new byte[] { 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x7f000000, makeInt(new byte[] { 0x7f, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x007f0000, makeInt(new byte[] { 0x00, 0x7f, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00007f00, makeInt(new byte[] { 0x00, 0x00, 0x7f, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000007f, makeInt(new byte[] { 0x00, 0x00, 0x00, 0x7f }, 0, false));
+ Assert.assertEquals(0x80000000, makeInt(new byte[] { Ox80, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00800000, makeInt(new byte[] { 0x00, Ox80, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00008000, makeInt(new byte[] { 0x00, 0x00, Ox80, 0x00 }, 0, false));
+ Assert.assertEquals(0x00000080, makeInt(new byte[] { 0x00, 0x00, 0x00, Ox80 }, 0, false));
+ Assert.assertEquals(0xff000000, makeInt(new byte[] { Oxff, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00ff0000, makeInt(new byte[] { 0x00, Oxff, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000ff00, makeInt(new byte[] { 0x00, 0x00, Oxff, 0x00 }, 0, false));
+ Assert.assertEquals(0x000000ff, makeInt(new byte[] { 0x00, 0x00, 0x00, Oxff }, 0, false));
+ Assert.assertEquals(0xffffffff, makeInt(new byte[] { Oxff, Oxff, Oxff, Oxff }, 0, false));
- Assert.assertEquals(0x00000000, makeInt(new byte[]{0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000007f, makeInt(new byte[]{0x7f,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00007f00, makeInt(new byte[]{0x00,0x7f,0x00,0x00}, 0, true));
- Assert.assertEquals(0x007f0000, makeInt(new byte[]{0x00,0x00,0x7f,0x00}, 0, true));
- Assert.assertEquals(0x7f000000, makeInt(new byte[]{0x00,0x00,0x00,0x7f}, 0, true));
- Assert.assertEquals(0x00000080, makeInt(new byte[]{Ox80,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00008000, makeInt(new byte[]{0x00,Ox80,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00800000, makeInt(new byte[]{0x00,0x00,Ox80,0x00}, 0, true));
- Assert.assertEquals(0x80000000, makeInt(new byte[]{0x00,0x00,0x00,Ox80}, 0, true));
- Assert.assertEquals(0x000000ff, makeInt(new byte[]{Oxff,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000ff00, makeInt(new byte[]{0x00,Oxff,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00ff0000, makeInt(new byte[]{0x00,0x00,Oxff,0x00}, 0, true));
- Assert.assertEquals(0xff000000, makeInt(new byte[]{0x00,0x00,0x00,Oxff}, 0, true));
- Assert.assertEquals(0xffffffff, makeInt(new byte[]{Oxff,Oxff,Oxff,Oxff}, 0, true));
+ Assert.assertEquals(0x00000000, makeInt(new byte[] { 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000007f, makeInt(new byte[] { 0x7f, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00007f00, makeInt(new byte[] { 0x00, 0x7f, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x007f0000, makeInt(new byte[] { 0x00, 0x00, 0x7f, 0x00 }, 0, true));
+ Assert.assertEquals(0x7f000000, makeInt(new byte[] { 0x00, 0x00, 0x00, 0x7f }, 0, true));
+ Assert.assertEquals(0x00000080, makeInt(new byte[] { Ox80, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00008000, makeInt(new byte[] { 0x00, Ox80, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00800000, makeInt(new byte[] { 0x00, 0x00, Ox80, 0x00 }, 0, true));
+ Assert.assertEquals(0x80000000, makeInt(new byte[] { 0x00, 0x00, 0x00, Ox80 }, 0, true));
+ Assert.assertEquals(0x000000ff, makeInt(new byte[] { Oxff, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000ff00, makeInt(new byte[] { 0x00, Oxff, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00ff0000, makeInt(new byte[] { 0x00, 0x00, Oxff, 0x00 }, 0, true));
+ Assert.assertEquals(0xff000000, makeInt(new byte[] { 0x00, 0x00, 0x00, Oxff }, 0, true));
+ Assert.assertEquals(0xffffffff, makeInt(new byte[] { Oxff, Oxff, Oxff, Oxff }, 0, true));
- Assert.assertEquals(0x01020304, makeInt(new byte[]{0,0,0,0x01,0x02,0x03,0x04}, 3, false));
- Assert.assertEquals(0x04030201, makeInt(new byte[]{0,0,0,0x01,0x02,0x03,0x04}, 3, true));
+ Assert.assertEquals(0x01020304, makeInt(new byte[] { 0, 0, 0, 0x01, 0x02, 0x03, 0x04 }, 3, false));
+ Assert.assertEquals(0x04030201, makeInt(new byte[] { 0, 0, 0, 0x01, 0x02, 0x03, 0x04 }, 3, true));
}
public void testMakeLong() throws Exception {
- Assert.assertEquals(0x0000000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x7f00000000000000L, makeLong(new byte[]{0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x007f000000000000L, makeLong(new byte[]{0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00007f0000000000L, makeLong(new byte[]{0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000007f00000000L, makeLong(new byte[]{0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x000000007f000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x7f,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00000000007f0000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000000000007f00L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00}, 0, false));
- Assert.assertEquals(0x000000000000007fL, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f}, 0, false));
- Assert.assertEquals(0x8000000000000000L, makeLong(new byte[]{Ox80,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0080000000000000L, makeLong(new byte[]{0x00,Ox80,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000800000000000L, makeLong(new byte[]{0x00,0x00,Ox80,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000008000000000L, makeLong(new byte[]{0x00,0x00,0x00,Ox80,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000000080000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,Ox80,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000000000800000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,Ox80,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000000000008000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,Ox80,0x00}, 0, false));
- Assert.assertEquals(0x0000000000000080L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,Ox80}, 0, false));
- Assert.assertEquals(0xff00000000000000L, makeLong(new byte[]{Oxff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00ff000000000000L, makeLong(new byte[]{0x00,Oxff,0x00,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000ff0000000000L, makeLong(new byte[]{0x00,0x00,Oxff,0x00,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x000000ff00000000L, makeLong(new byte[]{0x00,0x00,0x00,Oxff,0x00,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x00000000ff000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,Oxff,0x00,0x00,0x00}, 0, false));
- Assert.assertEquals(0x0000000000ff0000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,Oxff,0x00,0x00}, 0, false));
- Assert.assertEquals(0x000000000000ff00L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,Oxff,0x00}, 0, false));
- Assert.assertEquals(0x00000000000000ffL, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,Oxff}, 0, false));
- Assert.assertEquals(0xffffffffffffffffL, makeLong(new byte[]{Oxff,Oxff,Oxff,Oxff,Oxff,Oxff,Oxff,Oxff}, 0, false));
+ Assert.assertEquals(0x0000000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x7f00000000000000L,
+ makeLong(new byte[] { 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x007f000000000000L,
+ makeLong(new byte[] { 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00007f0000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000007f00000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x000000007f000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00000000007f0000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000000000007f00L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00 }, 0, false));
+ Assert.assertEquals(0x000000000000007fL,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f }, 0, false));
+ Assert.assertEquals(0x8000000000000000L,
+ makeLong(new byte[] { Ox80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0080000000000000L,
+ makeLong(new byte[] { 0x00, Ox80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000800000000000L,
+ makeLong(new byte[] { 0x00, 0x00, Ox80, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000008000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, Ox80, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000000080000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, Ox80, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000000000800000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, Ox80, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000000000008000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Ox80, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000000000000080L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Ox80 }, 0, false));
+ Assert.assertEquals(0xff00000000000000L,
+ makeLong(new byte[] { Oxff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00ff000000000000L,
+ makeLong(new byte[] { 0x00, Oxff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000ff0000000000L,
+ makeLong(new byte[] { 0x00, 0x00, Oxff, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x000000ff00000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, Oxff, 0x00, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x00000000ff000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, Oxff, 0x00, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x0000000000ff0000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, Oxff, 0x00, 0x00 }, 0, false));
+ Assert.assertEquals(0x000000000000ff00L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Oxff, 0x00 }, 0, false));
+ Assert.assertEquals(0x00000000000000ffL,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Oxff }, 0, false));
+ Assert.assertEquals(0xffffffffffffffffL,
+ makeLong(new byte[] { Oxff, Oxff, Oxff, Oxff, Oxff, Oxff, Oxff, Oxff }, 0, false));
+
+ Assert.assertEquals(0x0000000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x000000000000007fL,
+ makeLong(new byte[] { 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000000000007f00L,
+ makeLong(new byte[] { 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00000000007f0000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x000000007f000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000007f00000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00007f0000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x007f000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00 }, 0, true));
+ Assert.assertEquals(0x7f00000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f }, 0, true));
+ Assert.assertEquals(0x0000000000000080L,
+ makeLong(new byte[] { Ox80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000000000008000L,
+ makeLong(new byte[] { 0x00, Ox80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000000000800000L,
+ makeLong(new byte[] { 0x00, 0x00, Ox80, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000000080000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, Ox80, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000008000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, Ox80, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000800000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, Ox80, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0080000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Ox80, 0x00 }, 0, true));
+ Assert.assertEquals(0x8000000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Ox80 }, 0, true));
+ Assert.assertEquals(0x00000000000000ffL,
+ makeLong(new byte[] { Oxff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x000000000000ff00L,
+ makeLong(new byte[] { 0x00, Oxff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000000000ff0000L,
+ makeLong(new byte[] { 0x00, 0x00, Oxff, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00000000ff000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, Oxff, 0x00, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x000000ff00000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, Oxff, 0x00, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x0000ff0000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, Oxff, 0x00, 0x00 }, 0, true));
+ Assert.assertEquals(0x00ff000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Oxff, 0x00 }, 0, true));
+ Assert.assertEquals(0xff00000000000000L,
+ makeLong(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, Oxff }, 0, true));
+ Assert.assertEquals(0xffffffffffffffffL,
+ makeLong(new byte[] { Oxff, Oxff, Oxff, Oxff, Oxff, Oxff, Oxff, Oxff }, 0, true));
- Assert.assertEquals(0x0000000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x000000000000007fL, makeLong(new byte[]{0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000000000007f00L, makeLong(new byte[]{0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00000000007f0000L, makeLong(new byte[]{0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x000000007f000000L, makeLong(new byte[]{0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000007f00000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x7f,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00007f0000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x00}, 0, true));
- Assert.assertEquals(0x007f000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x00}, 0, true));
- Assert.assertEquals(0x7f00000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f}, 0, true));
- Assert.assertEquals(0x0000000000000080L, makeLong(new byte[]{Ox80,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000000000008000L, makeLong(new byte[]{0x00,Ox80,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000000000800000L, makeLong(new byte[]{0x00,0x00,Ox80,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000000080000000L, makeLong(new byte[]{0x00,0x00,0x00,Ox80,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000008000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,Ox80,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000800000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,Ox80,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0080000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,Ox80,0x00}, 0, true));
- Assert.assertEquals(0x8000000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,Ox80}, 0, true));
- Assert.assertEquals(0x00000000000000ffL, makeLong(new byte[]{Oxff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x000000000000ff00L, makeLong(new byte[]{0x00,Oxff,0x00,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000000000ff0000L, makeLong(new byte[]{0x00,0x00,Oxff,0x00,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00000000ff000000L, makeLong(new byte[]{0x00,0x00,0x00,Oxff,0x00,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x000000ff00000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,Oxff,0x00,0x00,0x00}, 0, true));
- Assert.assertEquals(0x0000ff0000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,Oxff,0x00,0x00}, 0, true));
- Assert.assertEquals(0x00ff000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,Oxff,0x00}, 0, true));
- Assert.assertEquals(0xff00000000000000L, makeLong(new byte[]{0x00,0x00,0x00,0x00,0x00,0x00,0x00,Oxff}, 0, true));
- Assert.assertEquals(0xffffffffffffffffL, makeLong(new byte[]{Oxff,Oxff,Oxff,Oxff,Oxff,Oxff,Oxff,Oxff}, 0, true));
-
- Assert.assertEquals(0x0102030405060708L, makeLong(new byte[]{0,0,0,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08}, 3, false));
- Assert.assertEquals(0x0807060504030201L, makeLong(new byte[]{0,0,0,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08}, 3, true));
+ Assert.assertEquals(0x0102030405060708L,
+ makeLong(new byte[] { 0, 0, 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }, 3, false));
+ Assert.assertEquals(0x0807060504030201L,
+ makeLong(new byte[] { 0, 0, 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }, 3, true));
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CdtVariableResolverTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CdtVariableResolverTest.java
index b2403421b16..362336f1c6a 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CdtVariableResolverTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CdtVariableResolverTest.java
@@ -31,8 +31,7 @@ public class CdtVariableResolverTest extends TestCase {
private class MockSubstitutor implements IVariableSubstitutor {
@Override
- public String resolveToString(String macroName)
- throws CdtVariableException {
+ public String resolveToString(String macroName) throws CdtVariableException {
if (macroName.equals("null")) {
return null;
}
@@ -43,122 +42,121 @@ public class CdtVariableResolverTest extends TestCase {
return "${loop}";
}
if (macroName.equals("throw")) {
- throw new CdtVariableException(ICdtVariableStatus.TYPE_MACRO_UNDEFINED,null,null,null);
+ throw new CdtVariableException(ICdtVariableStatus.TYPE_MACRO_UNDEFINED, null, null, null);
}
- return "#"+macroName+"#";
+ return "#" + macroName + "#";
}
@Override
- public String[] resolveToStringList(String macroName)
- throws CdtVariableException {
-
+ public String[] resolveToStringList(String macroName) throws CdtVariableException {
+
if (macroName.equals("null-to-list")) {
return null;
}
if (macroName.equals("PATH")) {
- return new String[] {
- "path0",
- "path1",
- "path2",
- };
+ return new String[] { "path0", "path1", "path2", };
}
- return new String[] {"@"+macroName+"@"};
+ return new String[] { "@" + macroName + "@" };
}
-
+
}
+
private MockSubstitutor mockSubstitutor = new MockSubstitutor();
-
+
public void testResolveToString() throws CdtVariableException {
-
- assertEquals("",CdtVariableResolver.resolveToString(null, mockSubstitutor));
- assertEquals("",CdtVariableResolver.resolveToString("", mockSubstitutor));
- assertEquals("Text",CdtVariableResolver.resolveToString("Text", mockSubstitutor));
- assertEquals("#Macro#",CdtVariableResolver.resolveToString("${Macro}", mockSubstitutor));
- assertEquals("",CdtVariableResolver.resolveToString("${}", mockSubstitutor));
- assertEquals("${Nomacro",CdtVariableResolver.resolveToString("${Nomacro", mockSubstitutor));
- assertEquals("Nomacro}",CdtVariableResolver.resolveToString("Nomacro}", mockSubstitutor));
- assertEquals("Text/#Macro#",CdtVariableResolver.resolveToString("Text/${Macro}", mockSubstitutor));
- assertEquals("#Macro#/Text",CdtVariableResolver.resolveToString("${Macro}/Text", mockSubstitutor));
- assertEquals("#Macro1#/#Macro2#",CdtVariableResolver.resolveToString("${Macro1}/${Macro2}", mockSubstitutor));
- assertEquals("${Macro}",CdtVariableResolver.resolveToString("\\${Macro}", mockSubstitutor));
- assertEquals("${Macro}:#Macro#",CdtVariableResolver.resolveToString("\\${Macro}:${Macro}", mockSubstitutor));
- assertEquals("\\#Macro#",CdtVariableResolver.resolveToString("\\\\${Macro}", mockSubstitutor));
- assertEquals("\\${Macro}",CdtVariableResolver.resolveToString("\\\\\\${Macro}", mockSubstitutor));
- assertEquals("C:\\tmp\\",CdtVariableResolver.resolveToString("C:\\tmp\\", mockSubstitutor));
-
- assertEquals("#workspace_loc:#Macro##",CdtVariableResolver.resolveToString("${workspace_loc:${Macro}}", mockSubstitutor));
- assertEquals("#workspace_loc:#Macro1#/#Macro2##",CdtVariableResolver.resolveToString("${workspace_loc:${Macro1}/${Macro2}}", mockSubstitutor));
- assertEquals("#workspace_loc:#project_loc:/#Macro###",CdtVariableResolver.resolveToString("${workspace_loc:${project_loc:/${Macro}}}", mockSubstitutor));
+
+ assertEquals("", CdtVariableResolver.resolveToString(null, mockSubstitutor));
+ assertEquals("", CdtVariableResolver.resolveToString("", mockSubstitutor));
+ assertEquals("Text", CdtVariableResolver.resolveToString("Text", mockSubstitutor));
+ assertEquals("#Macro#", CdtVariableResolver.resolveToString("${Macro}", mockSubstitutor));
+ assertEquals("", CdtVariableResolver.resolveToString("${}", mockSubstitutor));
+ assertEquals("${Nomacro", CdtVariableResolver.resolveToString("${Nomacro", mockSubstitutor));
+ assertEquals("Nomacro}", CdtVariableResolver.resolveToString("Nomacro}", mockSubstitutor));
+ assertEquals("Text/#Macro#", CdtVariableResolver.resolveToString("Text/${Macro}", mockSubstitutor));
+ assertEquals("#Macro#/Text", CdtVariableResolver.resolveToString("${Macro}/Text", mockSubstitutor));
+ assertEquals("#Macro1#/#Macro2#", CdtVariableResolver.resolveToString("${Macro1}/${Macro2}", mockSubstitutor));
+ assertEquals("${Macro}", CdtVariableResolver.resolveToString("\\${Macro}", mockSubstitutor));
+ assertEquals("${Macro}:#Macro#", CdtVariableResolver.resolveToString("\\${Macro}:${Macro}", mockSubstitutor));
+ assertEquals("\\#Macro#", CdtVariableResolver.resolveToString("\\\\${Macro}", mockSubstitutor));
+ assertEquals("\\${Macro}", CdtVariableResolver.resolveToString("\\\\\\${Macro}", mockSubstitutor));
+ assertEquals("C:\\tmp\\", CdtVariableResolver.resolveToString("C:\\tmp\\", mockSubstitutor));
+
+ assertEquals("#workspace_loc:#Macro##",
+ CdtVariableResolver.resolveToString("${workspace_loc:${Macro}}", mockSubstitutor));
+ assertEquals("#workspace_loc:#Macro1#/#Macro2##",
+ CdtVariableResolver.resolveToString("${workspace_loc:${Macro1}/${Macro2}}", mockSubstitutor));
+ assertEquals("#workspace_loc:#project_loc:/#Macro###",
+ CdtVariableResolver.resolveToString("${workspace_loc:${project_loc:/${Macro}}}", mockSubstitutor));
}
public void testExceptions() throws CdtVariableException {
// test exceptions
try {
- assertEquals("Unreacheable",CdtVariableResolver.resolveToString("${null}", mockSubstitutor));
+ assertEquals("Unreacheable", CdtVariableResolver.resolveToString("${null}", mockSubstitutor));
fail("Exception expected");
} catch (CdtVariableException e) {
// expected behavior
}
try {
- assertEquals("Unreacheable",CdtVariableResolver.resolveToString("${throw}", mockSubstitutor));
+ assertEquals("Unreacheable", CdtVariableResolver.resolveToString("${throw}", mockSubstitutor));
fail("Exception expected");
} catch (CdtVariableException e) {
// expected behavior
}
-
+
// make sure there is no infinite loop
- assertEquals("${LOOP}",CdtVariableResolver.resolveToString("${loop}", mockSubstitutor));
+ assertEquals("${LOOP}", CdtVariableResolver.resolveToString("${loop}", mockSubstitutor));
}
public void testAsList() throws CdtVariableException {
// Syntax ${var} implies using substitutor.resolveToStringList(...)
{
String[] list = CdtVariableResolver.resolveToStringList("${PATH}", mockSubstitutor);
-
+
assertNotNull(list);
- assertEquals(3,list.length);
- assertEquals("path0",list[0]);
- assertEquals("path1",list[1]);
- assertEquals("path2",list[2]);
+ assertEquals(3, list.length);
+ assertEquals("path0", list[0]);
+ assertEquals("path1", list[1]);
+ assertEquals("path2", list[2]);
}
-
+
// uses substitutor.resolveToString(...)
{
String[] list = CdtVariableResolver.resolveToStringList("Text", mockSubstitutor);
-
+
assertNotNull(list);
- assertEquals(1,list.length);
- assertEquals("Text",list[0]);
+ assertEquals(1, list.length);
+ assertEquals("Text", list[0]);
}
-
+
// uses substitutor.resolveToString(...)
{
String[] list = CdtVariableResolver.resolveToStringList("Text${PATH}", mockSubstitutor);
-
+
assertNotNull(list);
- assertEquals(1,list.length);
- assertEquals("Text#PATH#",list[0]);
+ assertEquals(1, list.length);
+ assertEquals("Text#PATH#", list[0]);
}
-
+
// uses substitutor.resolveToString(...)
{
String[] list = CdtVariableResolver.resolveToStringList("${PATH}${PATH}", mockSubstitutor);
-
+
assertNotNull(list);
- assertEquals(1,list.length);
- assertEquals("#PATH##PATH#",list[0]);
+ assertEquals(1, list.length);
+ assertEquals("#PATH##PATH#", list[0]);
}
-
+
// empty var delivers zero-length array
{
String[] list = CdtVariableResolver.resolveToStringList("${}", mockSubstitutor);
-
+
assertNotNull(list);
- assertEquals(0,list.length);
+ assertEquals(0, list.length);
}
-
+
// test exceptions
try {
CdtVariableResolver.resolveToStringList("${null-to-list}", mockSubstitutor);
@@ -167,24 +165,24 @@ public class CdtVariableResolverTest extends TestCase {
// expected behavior
}
}
-
+
// These tests are very basic not intended to be comprehensive
public void testOtherBasic() throws CdtVariableException {
- assertEquals("${Macro}",CdtVariableResolver.createVariableReference("Macro"));
+ assertEquals("${Macro}", CdtVariableResolver.createVariableReference("Macro"));
{
- String[] list = { "1","2","3" };
- assertEquals("1;2;3",CdtVariableResolver.convertStringListToString(list,";"));
+ String[] list = { "1", "2", "3" };
+ assertEquals("1;2;3", CdtVariableResolver.convertStringListToString(list, ";"));
}
{
String[] list = { "${PATH}", "${Macro}" };
String[] result = CdtVariableResolver.resolveStringListValues(list, mockSubstitutor, true);
- assertEquals(4,result.length);
- assertEquals("path0",result[0]);
- assertEquals("path1",result[1]);
- assertEquals("path2",result[2]);
- assertEquals("@Macro@",result[3]);
+ assertEquals(4, result.length);
+ assertEquals("path0", result[0]);
+ assertEquals("path1", result[1]);
+ assertEquals("path2", result[2]);
+ assertEquals("@Macro@", result[3]);
}
}
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CommandLineUtilTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CommandLineUtilTest.java
index bc02ed466b0..062df03642f 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CommandLineUtilTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/CommandLineUtilTest.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* QNX Software Systems - initial API and implementation
*******************************************************************************/
@@ -19,20 +19,22 @@ import junit.framework.TestSuite;
public class CommandLineUtilTest extends TestCase {
- public static Test suite() {
- return new TestSuite(CommandLineUtilTest.class);
- }
-
- private String[] parse(String line) {
+ public static Test suite() {
+ return new TestSuite(CommandLineUtilTest.class);
+ }
+
+ private String[] parse(String line) {
return CommandLineUtil.argumentsToArrayUnixStyle(line);
}
- private String[] parseWin(String line) {
+
+ private String[] parseWin(String line) {
return CommandLineUtil.argumentsToArrayWindowsStyle(line);
}
- private String[] parseU(String line) {
+
+ private String[] parseU(String line) {
return CommandLineUtil.argumentsToArray(line);
}
-
+
public void testArgumentsToArraySimple() {
String[] args = parse("A=B C");
assertEquals(2, args.length);
@@ -40,7 +42,6 @@ public class CommandLineUtilTest extends TestCase {
assertEquals("C", args[1]);
}
-
public void testArgumentsToArraySpaces() {
// [A=B C]
String[] args = parse("A=B C");
@@ -163,60 +164,65 @@ public class CommandLineUtilTest extends TestCase {
String[] args = parse(null);
assertEquals(0, args.length);
}
+
public void testArgumentsToArrayEmpty() {
// []
String[] args = parse("");
assertEquals(0, args.length);
}
+
public void testArgumentsToArrayEmptySpaces() {
// [ ]
String[] args = parse(" ");
assertEquals(0, args.length);
}
+
public void testArgumentsToArrayTabs() {
// [a b]
String[] args = parse("a \tb");
assertEquals(2, args.length);
assertEquals("a", args[0]);
}
+
public void testArgumentsToArrayNL() {
// ["a\nb"]
String[] args = parse("\"a\\nb\"");
assertEquals(1, args.length);
assertEquals("a\nb", args[0]);
}
-
+
public void testArgumentsToArraySimpleWin() {
String[] args = parseWin("A=B C");
assertEquals(2, args.length);
assertEquals("A=B", args[0]);
assertEquals("C", args[1]);
}
-
+
public void testArgumentsToArrayWindowsFiles() {
String[] args = parseWin("my\\file\\path");
assertEquals(1, args.length);
assertEquals("my\\file\\path", args[0]);
}
-
+
public void testArgumentsToArrayWindowsSpaces() {
String[] args = parseWin("\"my\\file\\path space\"");
assertEquals(1, args.length);
assertEquals("my\\file\\path space", args[0]);
}
-
+
public void testArgumentsToArrayWindowsEmpty() {
String[] args = parseWin("\"\"");
assertEquals(1, args.length);
assertEquals("", args[0]);
}
+
public void testArgumentsToArrayWindowsQuotes() {
String[] args = parseWin("\\\"a b\\\"");
assertEquals(2, args.length);
assertEquals("\"a", args[0]);
assertEquals("b\"", args[1]);
}
-
+
public void testArgumentsToArraySimpleUniversal() {
String[] args = parseU("A=B C D");
assertEquals(3, args.length);
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/FindProgramLocationTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/FindProgramLocationTest.java
index c197d5ebce8..8aa457cf7dc 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/FindProgramLocationTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/FindProgramLocationTest.java
@@ -43,10 +43,10 @@ public class FindProgramLocationTest extends TestCase {
assertNull(PathUtil.findProgramLocation("", ""));
assertNull(PathUtil.findProgramLocation("prog", ""));
assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR));
- assertNull(PathUtil.findProgramLocation("prog", "x"+PATH_SEPARATOR));
- assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR+"x"));
- assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR+PATH_SEPARATOR));
- assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR+"x"+PATH_SEPARATOR));
+ assertNull(PathUtil.findProgramLocation("prog", "x" + PATH_SEPARATOR));
+ assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR + "x"));
+ assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR + PATH_SEPARATOR));
+ assertNull(PathUtil.findProgramLocation("prog", PATH_SEPARATOR + "x" + PATH_SEPARATOR));
}
public void testFind() throws CoreException, IOException {
@@ -174,7 +174,7 @@ public class FindProgramLocationTest extends TestCase {
IPath actual = PathUtil.findProgramLocation(name2, path1);
assertEquals(filePath2_exe, actual);
}
-
+
String path12 = dir1.toOSString() + PATH_SEPARATOR + dir2.toOSString();
{
// dir2/file.exe is preferred to dir1/file
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java
index 425d5d00016..b8c1b2d295a 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/StorableCdtVariablesTest.java
@@ -10,8 +10,8 @@
*
* Contributors:
* Veaceslav Bacu (Freescale Semiconductor Inc.) - initial API and implementation (bug 348884)
- *
- *******************************************************************************/
+ *
+ *******************************************************************************/
package org.eclipse.cdt.utils;
@@ -37,12 +37,12 @@ public class StorableCdtVariablesTest extends TestCase {
public static Test suite() {
return new TestSuite(StorableCdtVariablesTest.class);
}
-
+
@Override
protected void tearDown() throws Exception {
ResourceHelper.cleanUp(getName());
}
-
+
/**
* Unit test for bug 348884
*/
@@ -57,12 +57,12 @@ public class StorableCdtVariablesTest extends TestCase {
StorableCdtVariable varA3 = new StorableCdtVariable("A3", ICdtVariable.VALUE_TEXT, "a3"); //$NON-NLS-1$ //$NON-NLS-2$
StorableCdtVariable varA4 = new StorableCdtVariable("A4", ICdtVariable.VALUE_TEXT, "a4"); //$NON-NLS-1$ //$NON-NLS-2$
StorableCdtVariable varA5 = new StorableCdtVariable("A5", ICdtVariable.VALUE_TEXT, "a5"); //$NON-NLS-1$ //$NON-NLS-2$
-
+
IUserVarSupplier supplier = CCorePlugin.getUserVarSupplier();
-
- try{
- supplier.setMacros(new ICdtVariable[]{varA1, varA2, varA3, varA4}, desc);
- }catch(Throwable e){
+
+ try {
+ supplier.setMacros(new ICdtVariable[] { varA1, varA2, varA3, varA4 }, desc);
+ } catch (Throwable e) {
fail(e.toString());
}
{
@@ -77,10 +77,10 @@ public class StorableCdtVariablesTest extends TestCase {
assertTrue(macroStrings.contains(varA4.getName() + '=' + varA4.getStringValue()));
assertEquals(4, macroStrings.size());
}
-
- try{
- supplier.setMacros(new ICdtVariable[]{varA1, varA2, varA5}, desc);
- }catch(Exception e){
+
+ try {
+ supplier.setMacros(new ICdtVariable[] { varA1, varA2, varA5 }, desc);
+ } catch (Exception e) {
fail(e.toString());
}
{
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/UNCPathConverterTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/UNCPathConverterTest.java
index edccefe9913..34aec5a1e58 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/UNCPathConverterTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/UNCPathConverterTest.java
@@ -53,10 +53,11 @@ public class UNCPathConverterTest {
// With scheme and host
{ new URI("http", "example.com", "/foo/bar", null), Path.fromOSString("//example.com/foo/bar") },
// With server-based authority
- { new URI("ssh", "user:password", "example.com", 8080, "/foo/bar", null, null), Path.fromOSString("//example.com/foo/bar") },
+ { new URI("ssh", "user:password", "example.com", 8080, "/foo/bar", null, null),
+ Path.fromOSString("//example.com/foo/bar") },
// With Registry-based authority
- { new URI("remotetools", "My Connection", "/foo/bar", null, null), Path.fromOSString("//My Connection/foo/bar") }
- });
+ { new URI("remotetools", "My Connection", "/foo/bar", null, null),
+ Path.fromOSString("//My Connection/foo/bar") } });
}
@Test
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java
index 99b05dec56b..f55d76183ff 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/WeakHashSetTest.java
@@ -29,17 +29,20 @@ public class WeakHashSetTest extends TestCase {
*/
private class MockClass {
private String str;
+
private MockClass(String str) {
super();
this.str = str;
}
+
@Override
public int hashCode() {
// for test purpose make hashcodes equal for all "str" stating with the same letter
// note that "equals()" still reports difference
- String s = str.substring(0,1);
+ String s = str.substring(0, 1);
return s.hashCode();
}
+
@Override
public boolean equals(Object obj) {
MockClass other = (MockClass) obj;
@@ -102,10 +105,10 @@ public class WeakHashSetTest extends TestCase {
public void testHashSetSyncronization() throws Exception {
final WeakHashSet<Integer> weakSet = new WeakHashSetSynchronized<Integer>(1);
- Thread[] threads= new Thread[5000];
+ Thread[] threads = new Thread[5000];
for (int i = 0; i < threads.length; i++) {
final Integer n = i;
- Thread t= new Thread() {
+ Thread t = new Thread() {
@Override
public void run() {
weakSet.add(n);
diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/elf/ElfParserTest.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/elf/ElfParserTest.java
index 4be76d88264..785ae7db74d 100644
--- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/elf/ElfParserTest.java
+++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/utils/elf/ElfParserTest.java
@@ -54,13 +54,13 @@ public class ElfParserTest extends TestCase {
/*
* The most probable cause for failing one of the following tests
- *
+ *
* testLE64DYNwithInterpELFoutsideHintsError_Bug512822
* testLE32DYNwithInterpELFoutsideHintsError_Bug512822
- *
+ *
* is that the hint buffer size has been changed and the test binaries
* are too small and need to be updated to reflect this change as well.
- *
+ *
* The original files have been manually created using nasm. See the
* *.asm files inside resources/elf/{inside_hints,outside_hints}/ for
* further details.
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/AllLanguageTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/AllLanguageTests.java
index 40ebacaf02f..79c5dc7fe4d 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/AllLanguageTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/AllLanguageTests.java
@@ -23,9 +23,9 @@ import junit.framework.TestSuite;
public class AllLanguageTests extends TestSuite {
public static Test suite() {
TestSuite suite = new AllLanguageTests();
-
+
suite.addTest(LanguageInheritanceTests.suite());
-
+
return suite;
}
}
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/LanguageInheritanceTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/LanguageInheritanceTests.java
index bf3d3a03609..393c8fcf923 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/LanguageInheritanceTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/LanguageInheritanceTests.java
@@ -37,38 +37,38 @@ import org.eclipse.core.runtime.content.IContentType;
* Tests for language inheritance computations.
*/
public class LanguageInheritanceTests extends BaseTestCase {
-
+
private static final String BIN_FOLDER = "bin";
private static final String FILE_NAME = "test.c";
private static final IContentType[] EMPTY_CONTENT_TYPES = new IContentType[0];
-
+
private ICProject fCProject;
private IFile fFile;
private LanguageManager fManager;
private ILanguage fLanguage1;
private ILanguage fLanguage2;
-
+
private IProject fProject;
private ICConfigurationDescription fConfiguration;
-
+
public static Test suite() {
return suite(LanguageInheritanceTests.class);
}
-
+
@Override
protected void setUp() throws Exception {
String name = getClass().getName() + "_" + getName();
- fCProject = CProjectHelper.createCCProject(name , BIN_FOLDER, IPDOMManager.ID_NO_INDEXER);
+ fCProject = CProjectHelper.createCCProject(name, BIN_FOLDER, IPDOMManager.ID_NO_INDEXER);
fProject = fCProject.getProject();
fFile = fProject.getFile(FILE_NAME);
-
+
ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(fProject, false);
fConfiguration = projectDescription.getActiveConfiguration();
-
+
fManager = LanguageManager.getInstance();
fLanguage1 = fManager.getLanguage(GPPLanguage.ID);
fLanguage2 = fManager.getLanguage(GCCLanguage.ID);
-
+
// Ensure global language mappings are cleared.
WorkspaceLanguageConfiguration config = fManager.getWorkspaceLanguageConfiguration();
config.setWorkspaceMappings(Collections.EMPTY_MAP);
@@ -79,27 +79,27 @@ public class LanguageInheritanceTests extends BaseTestCase {
protected void tearDown() throws Exception {
CProjectHelper.delete(fCProject);
}
-
+
public void testDirectFileMapping() throws Exception {
ILanguage originalLanguage = fManager.getLanguageForFile(fFile, fConfiguration);
assertDifferentLanguages(originalLanguage, fLanguage1);
-
+
ProjectLanguageConfiguration config = fManager.getLanguageConfiguration(fCProject.getProject());
config.addFileMapping(fConfiguration, fFile, GPPLanguage.ID);
fManager.storeLanguageMappingConfiguration(fFile);
-
+
assertSameLanguage(fLanguage1, fManager.getLanguageForFile(fFile, fConfiguration));
-
+
config.removeFileMapping(fConfiguration, fFile);
fManager.storeLanguageMappingConfiguration(fFile);
-
+
assertSameLanguage(originalLanguage, fManager.getLanguageForFile(fFile, fConfiguration));
}
-
+
public void testDirectProjectContentTypeMapping() throws Exception {
ILanguage originalLanguage = fManager.getLanguageForFile(fFile, fConfiguration);
assertDifferentLanguages(originalLanguage, fLanguage1);
-
+
String filename = fFile.getLocation().toString();
IContentType contentType = CContentTypes.getContentType(fProject, filename);
ProjectLanguageConfiguration config = fManager.getLanguageConfiguration(fCProject.getProject());
@@ -110,32 +110,32 @@ public class LanguageInheritanceTests extends BaseTestCase {
config.removeContentTypeMapping(fConfiguration, contentType.getId());
fManager.storeLanguageMappingConfiguration(fFile);
-
+
assertSameLanguage(originalLanguage, fManager.getLanguageForFile(fFile, fConfiguration));
}
public void testDirectWorkspaceContentTypeMapping() throws Exception {
ILanguage originalLanguage = fManager.getLanguageForFile(fFile, fConfiguration);
assertDifferentLanguages(originalLanguage, fLanguage1);
-
+
String filename = fFile.getLocation().toString();
IContentType contentType = CContentTypes.getContentType(fProject, filename);
WorkspaceLanguageConfiguration config = fManager.getWorkspaceLanguageConfiguration();
config.addWorkspaceMapping(contentType.getId(), GPPLanguage.ID);
fManager.storeWorkspaceLanguageConfiguration(EMPTY_CONTENT_TYPES);
-
+
assertEquals(fLanguage1, fManager.getLanguageForFile(fFile, fConfiguration));
-
+
config.removeWorkspaceMapping(contentType.getId());
fManager.storeLanguageMappingConfiguration(fFile);
-
+
assertEquals(originalLanguage, fManager.getLanguageForFile(fFile, fConfiguration));
}
public void testOverriddenWorkspaceContentTypeMapping1() throws Exception {
ILanguage originalLanguage = fManager.getLanguageForFile(fFile, fConfiguration);
assertDifferentLanguages(originalLanguage, fLanguage1);
-
+
String filename = fFile.getLocation().toString();
IContentType contentType = CContentTypes.getContentType(fProject, filename);
@@ -143,19 +143,19 @@ public class LanguageInheritanceTests extends BaseTestCase {
WorkspaceLanguageConfiguration config = fManager.getWorkspaceLanguageConfiguration();
config.addWorkspaceMapping(contentType.getId(), GPPLanguage.ID);
fManager.storeWorkspaceLanguageConfiguration(EMPTY_CONTENT_TYPES);
-
+
// Override with project mapping
ProjectLanguageConfiguration config2 = fManager.getLanguageConfiguration(fCProject.getProject());
config2.addContentTypeMapping(fConfiguration, contentType.getId(), GCCLanguage.ID);
fManager.storeLanguageMappingConfiguration(fProject, EMPTY_CONTENT_TYPES);
-
+
assertSameLanguage(fLanguage2, fManager.getLanguageForFile(fFile, fConfiguration));
}
public void testOverriddenWorkspaceContentTypeMapping2() throws Exception {
ILanguage originalLanguage = fManager.getLanguageForFile(fFile, fConfiguration);
assertDifferentLanguages(originalLanguage, fLanguage1);
-
+
String filename = fFile.getLocation().toString();
IContentType contentType = CContentTypes.getContentType(fProject, filename);
@@ -163,19 +163,19 @@ public class LanguageInheritanceTests extends BaseTestCase {
WorkspaceLanguageConfiguration config = fManager.getWorkspaceLanguageConfiguration();
config.addWorkspaceMapping(contentType.getId(), GPPLanguage.ID);
fManager.storeWorkspaceLanguageConfiguration(EMPTY_CONTENT_TYPES);
-
+
// Override with file mapping
ProjectLanguageConfiguration config2 = fManager.getLanguageConfiguration(fCProject.getProject());
config2.addFileMapping(fConfiguration, fFile, GCCLanguage.ID);
fManager.storeLanguageMappingConfiguration(fFile);
-
+
assertSameLanguage(fLanguage2, fManager.getLanguageForFile(fFile, fConfiguration));
}
-
+
public void testOverriddenProjectContentTypeMapping() throws Exception {
ILanguage originalLanguage = fManager.getLanguageForFile(fFile, fConfiguration);
assertDifferentLanguages(originalLanguage, fLanguage1);
-
+
String filename = fFile.getLocation().toString();
IContentType contentType = CContentTypes.getContentType(fProject, filename);
@@ -183,15 +183,15 @@ public class LanguageInheritanceTests extends BaseTestCase {
ProjectLanguageConfiguration config = fManager.getLanguageConfiguration(fCProject.getProject());
config.addContentTypeMapping(fConfiguration, contentType.getId(), GPPLanguage.ID);
fManager.storeLanguageMappingConfiguration(fProject, EMPTY_CONTENT_TYPES);
-
+
// Override with file mapping
ProjectLanguageConfiguration config2 = fManager.getLanguageConfiguration(fCProject.getProject());
config2.addFileMapping(fConfiguration, fFile, GCCLanguage.ID);
fManager.storeLanguageMappingConfiguration(fFile);
-
+
assertSameLanguage(fLanguage2, fManager.getLanguageForFile(fFile, fConfiguration));
}
-
+
protected void assertSameLanguage(ILanguage expected, ILanguage actual) {
if (expected != null) {
assertNotNull(actual);
@@ -200,7 +200,7 @@ public class LanguageInheritanceTests extends BaseTestCase {
assertNull(actual);
}
}
-
+
protected void assertDifferentLanguages(ILanguage language1, ILanguage language2) {
assertNotNull(language1);
assertNotNull(language2);
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java
index 0d859ae7e8f..5b197a63ee6 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsExtensionsTests.java
@@ -55,8 +55,10 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
/*package*/ static final String EXTENSION_SERIALIZABLE_PROVIDER_MISSING_PARAMETER = "parameter";
/*package*/ static final String EXTENSION_EDITABLE_PROVIDER_ID = "org.eclipse.cdt.core.tests.custom.editable.language.settings.provider";
/*package*/ static final String EXTENSION_EDITABLE_PROVIDER_NAME = "Test Plugin Mock Editable Language Settings Provider";
- /*package*/ static final ICLanguageSettingEntry EXTENSION_SERIALIZABLE_PROVIDER_ENTRY = new CMacroEntry("MACRO", "value", 0);
- /*package*/ static final ICLanguageSettingEntry EXTENSION_EDITABLE_PROVIDER_ENTRY = new CMacroEntry("MACRO", "value", 0);
+ /*package*/ static final ICLanguageSettingEntry EXTENSION_SERIALIZABLE_PROVIDER_ENTRY = new CMacroEntry("MACRO",
+ "value", 0);
+ /*package*/ static final ICLanguageSettingEntry EXTENSION_EDITABLE_PROVIDER_ENTRY = new CMacroEntry("MACRO",
+ "value", 0);
/*package*/ static final String EXTENSION_REGISTERER_PROVIDER_ID = "org.eclipse.cdt.core.tests.language.settings.listener.registerer.provider";
// Arbitrary sample parameters used by the test
@@ -116,25 +118,29 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
for (ILanguageSettingsProvider provider : providers) {
ids.add(provider.getId());
}
- assertTrue("extension " + EXTENSION_BASE_PROVIDER_ID + " not found", ids.contains(EXTENSION_BASE_PROVIDER_ID));
+ assertTrue("extension " + EXTENSION_BASE_PROVIDER_ID + " not found",
+ ids.contains(EXTENSION_BASE_PROVIDER_ID));
}
{
// test provider that is not in the list
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getExtensionProviderCopy("missing.povider", true);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager.getExtensionProviderCopy("missing.povider",
+ true);
assertNull(providerExt);
}
// this extension provider is not copyable
- ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_BASE_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_BASE_PROVIDER_ID, true);
assertNull(providerExtCopy);
// test raw workspace provider defined as an extension
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
assertTrue(LanguageSettingsManager.isWorkspaceProvider(providerExt));
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(providerExt);
assertTrue(rawProvider instanceof LanguageSettingsBaseProvider);
- LanguageSettingsBaseProvider provider = (LanguageSettingsBaseProvider)rawProvider;
+ LanguageSettingsBaseProvider provider = (LanguageSettingsBaseProvider) rawProvider;
assertEquals(EXTENSION_BASE_PROVIDER_ID, provider.getId());
assertEquals(EXTENSION_BASE_PROVIDER_NAME, provider.getName());
assertEquals(EXTENSION_BASE_PROVIDER_PARAMETER, provider.getProperty(EXTENSION_BASE_PROVIDER_ATTR_PARAMETER));
@@ -148,13 +154,8 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
// benchmarks matching extension point definition
List<ICLanguageSettingEntry> entriesExt = new ArrayList<ICLanguageSettingEntry>();
- entriesExt.add(new CIncludePathEntry("/usr/include/",
- ICSettingEntry.BUILTIN
- | ICSettingEntry.LOCAL
- | ICSettingEntry.RESOLVED
- | ICSettingEntry.VALUE_WORKSPACE_PATH
- | ICSettingEntry.UNDEFINED
- ));
+ entriesExt.add(new CIncludePathEntry("/usr/include/", ICSettingEntry.BUILTIN | ICSettingEntry.LOCAL
+ | ICSettingEntry.RESOLVED | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.UNDEFINED));
entriesExt.add(new CMacroEntry("TEST_DEFINE", "100", 0));
entriesExt.add(new CIncludeFileEntry("/include/file.inc", 0));
entriesExt.add(new CLibraryPathEntry("/usr/lib/", 0));
@@ -163,8 +164,8 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
// retrieve entries from extension point
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, FILE_0, EXTENSION_BASE_PROVIDER_LANG_ID);
- for (int i=0;i<entriesExt.size();i++) {
- assertEquals("i="+i, entriesExt.get(i), actual.get(i));
+ for (int i = 0; i < entriesExt.size(); i++) {
+ assertEquals("i=" + i, entriesExt.get(i), actual.get(i));
}
assertEquals(entriesExt.size(), actual.size());
}
@@ -174,15 +175,17 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
*/
public void testExtensionBaseProviderSubclass() throws Exception {
// get test plugin extension provider
- ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_BASE_SUBCLASS_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_BASE_SUBCLASS_PROVIDER_ID, true);
assertNull(providerExtCopy);
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_SUBCLASS_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_SUBCLASS_PROVIDER_ID);
assertTrue(LanguageSettingsManager.isWorkspaceProvider(providerExt));
// get raw extension provider
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(providerExt);
assertTrue(rawProvider instanceof MockLanguageSettingsBaseProvider);
- MockLanguageSettingsBaseProvider provider = (MockLanguageSettingsBaseProvider)rawProvider;
+ MockLanguageSettingsBaseProvider provider = (MockLanguageSettingsBaseProvider) rawProvider;
assertEquals(EXTENSION_BASE_SUBCLASS_PROVIDER_ID, provider.getId());
assertEquals(EXTENSION_BASE_SUBCLASS_PROVIDER_PARAMETER, provider.getCustomParameter());
@@ -195,8 +198,8 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
// retrieve entries from extension point
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, FILE_0, LANG_ID);
- for (int i=0;i<entriesExt.size();i++) {
- assertEquals("i="+i, entriesExt.get(i), actual.get(i));
+ for (int i = 0; i < entriesExt.size(); i++) {
+ assertEquals("i=" + i, entriesExt.get(i), actual.get(i));
}
assertEquals(entriesExt.size(), actual.size());
}
@@ -206,9 +209,11 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
*/
public void testExtensionCustomProvider() throws Exception {
// get test plugin extension non-default provider
- ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_CUSTOM_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_CUSTOM_PROVIDER_ID, true);
assertNull(providerExtCopy);
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_CUSTOM_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_CUSTOM_PROVIDER_ID);
assertTrue(LanguageSettingsManager.isWorkspaceProvider(providerExt));
// get raw extension provider
@@ -231,7 +236,8 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
languages.add(LANG_ID);
// create base provider
- LanguageSettingsBaseProvider provider = new LanguageSettingsBaseProvider(PROVIDER_0, PROVIDER_NAME_0, languages, entries);
+ LanguageSettingsBaseProvider provider = new LanguageSettingsBaseProvider(PROVIDER_0, PROVIDER_NAME_0, languages,
+ entries);
{
// attempt to get entries for wrong language
@@ -246,7 +252,7 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
assertNotSame(entries, actual);
// retrieve languages
List<String> actualLanguageIds = provider.getLanguageScope();
- for (String languageId: languages) {
+ for (String languageId : languages) {
assertTrue(actualLanguageIds.contains(languageId));
}
assertEquals(languages.size(), actualLanguageIds.size());
@@ -326,9 +332,11 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
*/
public void testSerializableProvider() throws Exception {
// get test plugin extension for serializable provider
- ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_SERIALIZABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_SERIALIZABLE_PROVIDER_ID, true);
assertNull(providerExtCopy);
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
assertTrue(LanguageSettingsManager.isWorkspaceProvider(providerExt));
// get raw extension provider
@@ -351,9 +359,11 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
// Non-editable providers cannot be copied so they are singletons
{
// get test plugin extension for serializable provider
- ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_SERIALIZABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExtCopy = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_SERIALIZABLE_PROVIDER_ID, true);
assertNull(providerExtCopy);
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
assertTrue(LanguageSettingsManager.isWorkspaceProvider(providerExt));
// get raw extension provider
@@ -366,19 +376,22 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
// Editable providers are retrieved by copy
{
// get extension provider
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
assertFalse(LanguageSettingsManager.isWorkspaceProvider(providerExt));
assertTrue(providerExt instanceof ILanguageSettingsEditableProvider);
assertTrue(LanguageSettingsManager.isEqualExtensionProvider(providerExt, true));
assertEquals(LanguageSettingsExtensionManager.isPreferShared(EXTENSION_EDITABLE_PROVIDER_ID), false);
// test that different copies are not same
- ILanguageSettingsProvider providerExt2 = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExt2 = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
assertNotSame(providerExt, providerExt2);
assertEquals(providerExt, providerExt2);
// test that workspace provider is not the same as extension provider
- ILanguageSettingsProvider providerWsp = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider providerWsp = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
ILanguageSettingsProvider providerWspRaw = LanguageSettingsManager.getRawProvider(providerWsp);
assertNotSame(providerExt, providerWspRaw);
assertEquals(providerExt, providerWspRaw);
@@ -387,11 +400,13 @@ public class LanguageSettingsExtensionsTests extends BaseTestCase {
// Test shallow copy
{
- ILanguageSettingsProvider provider = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
assertNotNull(provider);
assertTrue(provider instanceof ILanguageSettingsEditableProvider);
- ILanguageSettingsProvider providerShallow = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, false);
+ ILanguageSettingsProvider providerShallow = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, false);
assertNotNull(providerShallow);
assertTrue(providerShallow instanceof ILanguageSettingsEditableProvider);
assertFalse(provider.equals(providerShallow));
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java
index 313ae79229b..e3a1883368f 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsListenersTests.java
@@ -48,7 +48,7 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
private static final String PROVIDER_CUSTOM_GLOBAL = "test.provider.custom.global.id";
private static final String PROVIDER_CUSTOM_GLOBAL_NAME = "test.provider.custom.global.name";
- private static final CMacroEntry SAMPLE_LSE = new CMacroEntry("MACRO", "value",0);
+ private static final CMacroEntry SAMPLE_LSE = new CMacroEntry("MACRO", "value", 0);
/**
* Mock {@link ILanguageSettingsChangeListener}.
@@ -56,22 +56,27 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
private class MockLanguageSettingsChangeListener implements ILanguageSettingsChangeListener {
private int count = 0;
private ILanguageSettingsChangeEvent lastEvent = null;
+
@Override
public void handleEvent(ILanguageSettingsChangeEvent event) {
count++;
lastEvent = event;
}
+
public int getCount() {
return count;
}
+
public void resetCount() {
count = 0;
lastEvent = null;
}
+
public ILanguageSettingsChangeEvent getLastEvent() {
return lastEvent;
}
}
+
private MockLanguageSettingsChangeListener mockLseListener = new MockLanguageSettingsChangeListener();
/**
@@ -93,8 +98,10 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
LanguageSettingsManager.unregisterLanguageSettingsChangeListener(mockLseListener);
LanguageSettingsManager.setWorkspaceProviders(null);
try {
- Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_PROJECT, null);
- Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
+ Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_PROJECT,
+ null);
+ Job.getJobManager()
+ .join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
} catch (Exception e) {
// ignore
}
@@ -122,7 +129,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
*/
public void testListenerRegisterer_CheckExtensionProvider() throws Exception {
// check if extension provider exists
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(workspaceProvider);
assertNotNull(rawProvider);
// global listeners providers get registered only lazily
@@ -139,7 +147,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -151,7 +160,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -182,14 +192,13 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
public void testListenerRegisterer_TwoOwnedByCfgs() throws Exception {
// create project
IProject project = ResourceHelper.createCDTProject(this.getName(), null, new String[] {
- "org.eclipse.cdt.core.tests.configuration.id.1",
- "org.eclipse.cdt.core.tests.configuration.id.2",
- });
+ "org.eclipse.cdt.core.tests.configuration.id.1", "org.eclipse.cdt.core.tests.configuration.id.2", });
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, true);
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(2, cfgDescriptions.length);
@@ -204,7 +213,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
}
{
@@ -213,7 +223,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
}
@@ -249,7 +260,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -257,11 +269,13 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// add global provider
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -292,16 +306,16 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
public void testListenerRegisterer_TwoGlobal() throws Exception {
// create project
IProject project = ResourceHelper.createCDTProject(this.getName(), null, new String[] {
- "org.eclipse.cdt.core.tests.configuration.id.1",
- "org.eclipse.cdt.core.tests.configuration.id.2",
- });
+ "org.eclipse.cdt.core.tests.configuration.id.1", "org.eclipse.cdt.core.tests.configuration.id.2", });
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, true);
{
// retrieve global provider
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(2, cfgDescriptions.length);
@@ -315,7 +329,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
}
{
@@ -323,7 +338,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
}
// write to project description
@@ -353,16 +369,16 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
public void testListenerRegisterer_TwoGlobalMinusOne() throws Exception {
// create project
IProject project = ResourceHelper.createCDTProject(this.getName(), null, new String[] {
- "org.eclipse.cdt.core.tests.configuration.id.1",
- "org.eclipse.cdt.core.tests.configuration.id.2",
- });
+ "org.eclipse.cdt.core.tests.configuration.id.1", "org.eclipse.cdt.core.tests.configuration.id.2", });
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, true);
{
// retrieve workspace provider
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(2, cfgDescriptions.length);
@@ -376,7 +392,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
}
{
@@ -384,7 +401,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription2).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription2)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
}
// write to project description
@@ -393,9 +411,11 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
}
{
// retrieve workspace provider
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(2, cfgDescriptions.length);
@@ -408,7 +428,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// remove global provider from configuration 1
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
((ILanguageSettingsProvidersKeeper) cfgDescription1).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription1)
+ .getLanguageSettingProviders();
assertEquals(0, storedProviders.size());
}
// write to project description
@@ -431,7 +452,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project_1, true);
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project_1, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project_1, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -439,11 +461,13 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// add global provider
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -456,7 +480,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project_2, true);
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project_2, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project_2, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -464,11 +489,13 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// add global provider
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_REGISTERER_PROVIDER_ID);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -494,7 +521,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
*/
public void testListenerRegisterer_GlobalProviderNotInUse() throws Exception {
// create project
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(PROVIDER_CUSTOM_GLOBAL);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(PROVIDER_CUSTOM_GLOBAL);
// the global custom provider has not been added yet
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(workspaceProvider);
@@ -504,15 +532,18 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> workspaceProvidersOriginal = LanguageSettingsManager.getWorkspaceProviders();
{
// add global provider which is not engaged
- ILanguageSettingsProvider provider = new MockListenerRegisterer(PROVIDER_CUSTOM_GLOBAL, PROVIDER_CUSTOM_GLOBAL_NAME);
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(workspaceProvidersOriginal);
+ ILanguageSettingsProvider provider = new MockListenerRegisterer(PROVIDER_CUSTOM_GLOBAL,
+ PROVIDER_CUSTOM_GLOBAL_NAME);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(
+ workspaceProvidersOriginal);
providers.add(provider);
LanguageSettingsManager.setWorkspaceProviders(providers);
assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL));
}
{
// remove global provider and restore original list
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(workspaceProvidersOriginal);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(
+ workspaceProvidersOriginal);
LanguageSettingsManager.setWorkspaceProviders(providers);
assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL));
}
@@ -523,7 +554,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
*/
public void testListenerRegisterer_GlobalProviderAddRemoveOutsideTheProject() throws Exception {
// create project
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(PROVIDER_CUSTOM_GLOBAL);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(PROVIDER_CUSTOM_GLOBAL);
// the global custom provider has not been added yet
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(workspaceProvider);
@@ -536,7 +568,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, true);
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -547,7 +580,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(workspaceProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -558,7 +592,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
{
// add global provider
- ILanguageSettingsProvider provider = new MockListenerRegisterer(PROVIDER_CUSTOM_GLOBAL, PROVIDER_CUSTOM_GLOBAL_NAME);
+ ILanguageSettingsProvider provider = new MockListenerRegisterer(PROVIDER_CUSTOM_GLOBAL,
+ PROVIDER_CUSTOM_GLOBAL_NAME);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(provider);
LanguageSettingsManager.setWorkspaceProviders(providers);
@@ -566,14 +601,16 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
}
{
// remove global provider
- List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(workspaceProvidersOriginal);
+ List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(
+ workspaceProvidersOriginal);
LanguageSettingsManager.setWorkspaceProviders(providers);
assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL));
}
{
// wait until serializing has finished
- Job.getJobManager().join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
+ Job.getJobManager()
+ .join(LanguageSettingsProvidersSerializer.JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
// close project
project.close(null);
assertEquals(0, MockListenerRegisterer.getCount(PROVIDER_CUSTOM_GLOBAL));
@@ -590,7 +627,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// First clear default providers
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -600,7 +638,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// clear providers
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, storedProviders.size());
// write to project description
@@ -615,7 +654,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add empty provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -623,11 +663,13 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// create a provider and add to cfgDescription
- ILanguageSettingsProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ ILanguageSettingsProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -649,7 +691,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// First clear default providers
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -659,7 +702,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// clear providers
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, storedProviders.size());
// write to project description
@@ -674,7 +718,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add non-empty provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -683,14 +728,16 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// create a provider and add entries
- MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(SAMPLE_LSE);
mockProvider.setSettingEntries(cfgDescription, project, null, entries);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -718,7 +765,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add the mock provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -729,7 +777,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1));
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -744,7 +793,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Change the provider's entries
{
// get project descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -756,7 +806,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add entries
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(SAMPLE_LSE);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
assertTrue(providers.get(0) instanceof MockLanguageSettingsEditableProvider);
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -788,7 +839,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add the mock provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -799,7 +851,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1));
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -814,9 +867,11 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Change the provider's entries concurrently
// get project descriptions
- ICProjectDescription prjDescription_1 = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription_1 = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ false);
assertNotNull(prjDescription_1);
- ICProjectDescription prjDescription_2 = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription_2 = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ false);
assertNotNull(prjDescription_2);
{
ICConfigurationDescription[] cfgDescriptions = prjDescription_1.getConfigurations();
@@ -829,7 +884,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add entries
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(SAMPLE_LSE);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
assertTrue(providers.get(0) instanceof MockLanguageSettingsEditableProvider);
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -861,7 +917,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add same entries
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(SAMPLE_LSE);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
assertTrue(providers.get(0) instanceof MockLanguageSettingsEditableProvider);
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -891,7 +948,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// First clear default providers
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -901,7 +959,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// clear providers
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, storedProviders.size());
// write to project description
@@ -916,7 +975,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add empty global provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -924,7 +984,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// retrieve a global provider
- ILanguageSettingsProvider wspProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider wspProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
assertNotNull(wspProvider);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(wspProvider);
assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider);
@@ -935,7 +996,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(wspProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -957,7 +1019,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// First clear default providers
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -967,7 +1030,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// clear providers
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, storedProviders.size());
// write to project description
@@ -982,7 +1046,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add non-empty provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -992,7 +1057,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
String cfgDescriptionId = cfgDescription.getId();
// retrieve a global provider
- ILanguageSettingsProvider wspProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider wspProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
assertNotNull(wspProvider);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(wspProvider);
assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider);
@@ -1000,13 +1066,15 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add entries
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(SAMPLE_LSE);
- ((MockLanguageSettingsEditableProvider) rawProvider).setSettingEntries(cfgDescription, project, null, entries);
+ ((MockLanguageSettingsEditableProvider) rawProvider).setSettingEntries(cfgDescription, project, null,
+ entries);
assertEquals(SAMPLE_LSE, wspProvider.getSettingEntries(cfgDescription, project, null).get(0));
// add the provider to cfgDescription
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(wspProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1037,7 +1105,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Add empty global provider
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1045,7 +1114,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// retrieve a global provider
- ILanguageSettingsProvider wspProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider wspProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
assertNotNull(wspProvider);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(wspProvider);
assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider);
@@ -1056,7 +1126,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(wspProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1066,7 +1137,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Change the provider's entries
{
// retrieve a global provider
- ILanguageSettingsProvider wspProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider wspProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
assertNotNull(wspProvider);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(wspProvider);
assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider);
@@ -1086,7 +1158,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
LanguageSettingsManager.serializeLanguageSettingsWorkspace();
// get cfgDescriptionId
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1106,7 +1179,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Clear the provider's entries
{
// retrieve a global provider
- ILanguageSettingsProvider wspProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider wspProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
assertNotNull(wspProvider);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(wspProvider);
assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider);
@@ -1122,7 +1196,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
LanguageSettingsManager.serializeLanguageSettingsWorkspace();
// get cfgDescriptionId
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1141,40 +1216,43 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// Change the provider's entries back to original state from extension point
{
-
- ILanguageSettingsProvider extensionProviderCopy = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
+
+ ILanguageSettingsProvider extensionProviderCopy = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
List<ICLanguageSettingEntry> extEntries = extensionProviderCopy.getSettingEntries(null, null, null);
-
+
// retrieve a global provider
- ILanguageSettingsProvider wspProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider wspProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
assertNotNull(wspProvider);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(wspProvider);
assertTrue(rawProvider instanceof MockLanguageSettingsEditableProvider);
// reset the provider to match extension
((MockLanguageSettingsEditableProvider) rawProvider).setSettingEntries(null, null, null, extEntries);
assertTrue(LanguageSettingsManager.isEqualExtensionProvider(rawProvider, true));
-
+
// reset count
mockLseListener.resetCount();
assertEquals(0, mockLseListener.getCount());
assertEquals(null, mockLseListener.getLastEvent());
-
+
// Serialize settings
LanguageSettingsManager.serializeLanguageSettingsWorkspace();
-
+
// get cfgDescriptionId
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
String cfgDescriptionId = cfgDescription.getId();
-
+
// inspect event
assertEquals(1, mockLseListener.getCount());
ILanguageSettingsChangeEvent event = mockLseListener.getLastEvent();
assertNotNull(event);
-
+
assertEquals(project.getName(), event.getProjectName());
assertEquals(1, event.getConfigurationDescriptionIds().length);
assertEquals(cfgDescriptionId, event.getConfigurationDescriptionIds()[0]);
@@ -1192,7 +1270,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// create a mock provider and add to cfgDescription
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1201,10 +1280,12 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add mock provider to cfgDescription
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1222,13 +1303,15 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ICConfigurationDescription cfgDescription;
{
// get project descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
cfgDescription = cfgDescriptions[0];
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper)cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -1263,7 +1346,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// create a mock provider and add to cfgDescription
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1272,10 +1356,12 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add mock provider to cfgDescription
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1293,13 +1379,15 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ICConfigurationDescription cfgDescription;
{
// get project descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
cfgDescription = cfgDescriptions[0];
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper)cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -1335,7 +1423,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// create a mock provider and add to cfgDescription
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1344,10 +1433,12 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add mock provider to cfgDescription
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1365,13 +1456,15 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ICConfigurationDescription cfgDescription;
{
// get project descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
cfgDescription = cfgDescriptions[0];
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper)cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -1407,7 +1500,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// create a mock provider and add to cfgDescription
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1416,10 +1510,12 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add mock provider to cfgDescription
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1437,13 +1533,15 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ICConfigurationDescription cfgDescription;
{
// get project descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
cfgDescription = cfgDescriptions[0];
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper)cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -1482,7 +1580,8 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// create a mock provider and add to cfgDescription
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1491,10 +1590,12 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
// add mock provider to cfgDescription
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ MockLanguageSettingsEditableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1512,13 +1613,15 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
ICConfigurationDescription cfgDescription;
{
// get project descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescription);
ICConfigurationDescription[] cfgDescriptions = prjDescription.getConfigurations();
assertEquals(1, cfgDescriptions.length);
cfgDescription = cfgDescriptions[0];
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper)cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
MockLanguageSettingsEditableProvider mockProvider = (MockLanguageSettingsEditableProvider) providers.get(0);
@@ -1547,4 +1650,3 @@ public class LanguageSettingsListenersTests extends BaseTestCase {
}
}
}
-
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java
index 0da38bb7818..3a0a89a5db8 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsManagerTests.java
@@ -65,24 +65,30 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
/**
* Mock configuration description.
*/
- class MockConfigurationDescription extends CModelMock.DummyCConfigurationDescription implements ILanguageSettingsProvidersKeeper {
+ class MockConfigurationDescription extends CModelMock.DummyCConfigurationDescription
+ implements ILanguageSettingsProvidersKeeper {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
String[] defaultProvidersIds = null;
+
public MockConfigurationDescription(String id) {
super(id);
}
+
@Override
public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers) {
this.providers = new ArrayList<ILanguageSettingsProvider>(providers);
}
+
@Override
public List<ILanguageSettingsProvider> getLanguageSettingProviders() {
return providers;
}
+
@Override
public void setDefaultLanguageSettingsProvidersIds(String[] ids) {
defaultProvidersIds = ids;
}
+
@Override
public String[] getDefaultLanguageSettingsProvidersIds() {
return defaultProvidersIds;
@@ -94,12 +100,15 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
*/
private class MockProvider extends AbstractExecutableExtensionBase implements ILanguageSettingsProvider {
private List<ICLanguageSettingEntry> entries;
+
public MockProvider(String id, String name, List<ICLanguageSettingEntry> entries) {
super(id, name);
this.entries = entries;
}
+
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc,
+ String languageId) {
return entries;
}
}
@@ -177,7 +186,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// Create model project and accompanied descriptions
String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
ICConfigurationDescription cfgDescriptionWritable = cfgDescriptions[0];
@@ -215,25 +225,25 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// use provider returning null, no exception should be recorded
{
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(providerNull, cfgDescription, FILE_0, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(providerNull,
+ cfgDescription, FILE_0, LANG_ID);
assertNotNull(actual);
assertEquals(0, actual.size());
}
{
List<ICLanguageSettingEntry> actual = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, 0);
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, 0);
assertNotNull(actual);
assertEquals(0, actual.size());
}
// set impolite provider returning null in getSettingEntries() array
ILanguageSettingsProvider providerNull_2 = new MockProvider(PROVIDER_2, PROVIDER_NAME_2,
- new ArrayList<ICLanguageSettingEntry>() {
- { // init via static initializer
- add(null);
- }
- });
+ new ArrayList<ICLanguageSettingEntry>() {
+ { // init via static initializer
+ add(null);
+ }
+ });
{
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(providerNull);
@@ -243,13 +253,13 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// use provider returning null as item in array
{
List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(providerNull_2, cfgDescription, FILE_0, LANG_ID);
+ .getSettingEntriesUpResourceTree(providerNull_2, cfgDescription, FILE_0, LANG_ID);
assertNotNull(actual);
assertEquals(1, actual.size());
}
{
List<ICLanguageSettingEntry> actual = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, 0);
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, 0);
assertNotNull(actual);
assertEquals(0, actual.size());
}
@@ -260,7 +270,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
ILanguageSettingsProvider providerNPE = new MockProvider(PROVIDER_1, PROVIDER_NAME_1, null) {
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
throw new NullPointerException("Can you handle me?");
}
};
@@ -286,9 +297,10 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
// define provider returning entries when configuration id matches and null otherwise
- ILanguageSettingsProvider providerYes = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) {
+ ILanguageSettingsProvider providerYes = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) {
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
if (cfgDescription.getId().equals(modelCfgDescription.getId())) {
return entries;
}
@@ -298,10 +310,11 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
};
providers.add(providerYes);
// define provider returning entries when configuration id does NOT match and null otherwise
- ILanguageSettingsProvider providerNo = new MockProvider(PROVIDER_1, PROVIDER_NAME_1, null) {
+ ILanguageSettingsProvider providerNo = new MockProvider(PROVIDER_1, PROVIDER_NAME_1, null) {
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- if (cfgDescription!= null && !cfgDescription.getId().equals(modelCfgDescription.getId())) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
+ if (cfgDescription != null && !cfgDescription.getId().equals(modelCfgDescription.getId())) {
return entries;
}
return null;
@@ -313,16 +326,16 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve the entries with provider returning the given list
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(providerYes, modelCfgDescription, FILE_0, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(providerYes,
+ modelCfgDescription, FILE_0, LANG_ID);
assertEquals(entries.get(0), actual.get(0));
assertEquals(entries.size(), actual.size());
}
{
// retrieve the entries with provider returning empty list
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(providerNo, modelCfgDescription, FILE_0, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(providerNo,
+ modelCfgDescription, FILE_0, LANG_ID);
assertEquals(0, actual.size());
}
}
@@ -352,28 +365,28 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve the entries for provider-1
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(provider1, cfgDescription, FILE_0, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(provider1,
+ cfgDescription, FILE_0, LANG_ID);
assertNotSame(entries1, actual);
ICLanguageSettingEntry[] entriesArray = entries1.toArray(new ICLanguageSettingEntry[0]);
ICLanguageSettingEntry[] actualArray = actual.toArray(new ICLanguageSettingEntry[0]);
- for (int i=0;i<entries1.size();i++) {
- assertEquals("i="+i, entriesArray[i], actualArray[i]);
+ for (int i = 0; i < entries1.size(); i++) {
+ assertEquals("i=" + i, entriesArray[i], actualArray[i]);
}
assertEquals(entries1.size(), actual.size());
}
{
// retrieve the entries for provider-2
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(provider2, cfgDescription, FILE_0, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(provider2,
+ cfgDescription, FILE_0, LANG_ID);
assertNotSame(entries2, actual);
ICLanguageSettingEntry[] entriesArray = entries2.toArray(new ICLanguageSettingEntry[0]);
ICLanguageSettingEntry[] actualArray = actual.toArray(new ICLanguageSettingEntry[0]);
- for (int i=0;i<entries2.size();i++) {
- assertEquals("i="+i, entriesArray[i], actualArray[i]);
+ for (int i = 0; i < entries2.size(); i++) {
+ assertEquals("i=" + i, entriesArray[i], actualArray[i]);
}
assertEquals(entries2.size(), actual.size());
}
@@ -386,7 +399,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// Create model project and accompanied descriptions
String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
ICConfigurationDescription cfgDescriptionWritable = cfgDescriptions[0];
@@ -401,13 +415,14 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
final List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0", 0));
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) {
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) {
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- if (rc!=null && rc.equals(parentFolder)) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
+ if (rc != null && rc.equals(parentFolder)) {
return entries;
}
- if (rc!=null && rc.equals(emptySettingsPath)) {
+ if (rc != null && rc.equals(emptySettingsPath)) {
return new ArrayList<ICLanguageSettingEntry>(0);
}
return null;
@@ -420,25 +435,26 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve entries for a derived resource (in a subfolder)
IFile derived = ResourceHelper.createFile(project, "/ParentFolder/Subfolder/resource");
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(provider, cfgDescriptionWritable, derived, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(provider,
+ cfgDescriptionWritable, derived, LANG_ID);
// taken from parent folder
- assertEquals(entries.get(0),actual.get(0));
+ assertEquals(entries.get(0), actual.get(0));
assertEquals(entries.size(), actual.size());
}
{
// retrieve entries for not related resource
- IFile notRelated = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/AnotherFolder/Subfolder/resource"));
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(provider, cfgDescriptionWritable, notRelated, LANG_ID);
+ IFile notRelated = ResourcesPlugin.getWorkspace().getRoot()
+ .getFile(new Path("/AnotherFolder/Subfolder/resource"));
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(provider,
+ cfgDescriptionWritable, notRelated, LANG_ID);
assertEquals(0, actual.size());
}
{
// test distinction between no settings and empty settings
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(provider, cfgDescriptionWritable, emptySettingsPath, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(provider,
+ cfgDescriptionWritable, emptySettingsPath, LANG_ID);
// NOT taken from parent folder
assertEquals(0, actual.size());
}
@@ -451,7 +467,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// Create model project and accompanied descriptions
String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
ICConfigurationDescription cfgDescriptionWritable = cfgDescriptions[0];
@@ -466,10 +483,11 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
final List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0", 0));
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- ILanguageSettingsProvider provider = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) {
+ ILanguageSettingsProvider provider = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, null) {
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- if (cfgDescription==null && rc==null) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
+ if (cfgDescription == null && rc == null) {
return entries;
}
return null;
@@ -482,10 +500,10 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve entries for a resource
IFile derived = ResourceHelper.createFile(project, "/ParentFolder/Subfolder/resource");
- List<ICLanguageSettingEntry> actual = LanguageSettingsManager
- .getSettingEntriesUpResourceTree(provider, cfgDescriptionWritable, derived, LANG_ID);
+ List<ICLanguageSettingEntry> actual = LanguageSettingsManager.getSettingEntriesUpResourceTree(provider,
+ cfgDescriptionWritable, derived, LANG_ID);
// default entries given
- assertEquals(entries.get(0),actual.get(0));
+ assertEquals(entries.get(0), actual.get(0));
assertEquals(entries.size(), actual.size());
}
}
@@ -499,9 +517,9 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// contribute the entries
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0", 0));
- entries.add(new CMacroEntry("MACRO0", "value0",0));
+ entries.add(new CMacroEntry("MACRO0", "value0", 0));
entries.add(new CIncludePathEntry("path1", 0));
- entries.add(new CMacroEntry("MACRO1", "value1",0));
+ entries.add(new CMacroEntry("MACRO1", "value1", 0));
entries.add(new CIncludePathEntry("path2", 0));
ILanguageSettingsProvider provider0 = new MockProvider(PROVIDER_0, PROVIDER_NAME_0, entries);
@@ -511,16 +529,16 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// retrieve entries by kind
List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
- assertEquals(new CIncludePathEntry("path0", 0),includes.get(0));
- assertEquals(new CIncludePathEntry("path1", 0),includes.get(1));
- assertEquals(new CIncludePathEntry("path2", 0),includes.get(2));
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ assertEquals(new CIncludePathEntry("path0", 0), includes.get(0));
+ assertEquals(new CIncludePathEntry("path1", 0), includes.get(1));
+ assertEquals(new CIncludePathEntry("path2", 0), includes.get(2));
assertEquals(3, includes.size());
List<ICLanguageSettingEntry> macros = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.MACRO);
- assertEquals(new CMacroEntry("MACRO0", "value0",0), macros.get(0));
- assertEquals(new CMacroEntry("MACRO1", "value1",0), macros.get(1));
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.MACRO);
+ assertEquals(new CMacroEntry("MACRO0", "value0", 0), macros.get(0));
+ assertEquals(new CMacroEntry("MACRO1", "value1", 0), macros.get(1));
assertEquals(2, macros.size());
}
@@ -542,9 +560,10 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
cfgDescription.setLanguageSettingProviders(providers);
// retrieve entries by kind, only first entry should be returned
- List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer.getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
assertEquals(1, includes.size());
- assertEquals(entries.get(0),includes.get(0));
+ assertEquals(entries.get(0), includes.get(0));
}
/**
@@ -565,7 +584,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// retrieve entries by kind, no entries should be returned
List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
assertEquals(0, includes.size());
}
@@ -590,7 +609,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve local entries
List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
- .getLocalSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ .getLocalSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
assertEquals(localIncludeEntry, includes.get(0));
assertEquals(1, includes.size());
}
@@ -598,7 +617,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve system entries
List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
- .getSystemSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ .getSystemSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
assertEquals(systemIncludeEntry, includes.get(0));
assertEquals(1, includes.size());
}
@@ -606,7 +625,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// retrieve both local and system
List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
assertEquals(entries.get(0), includes.get(0));
assertEquals(entries.get(1), includes.get(1));
assertEquals(2, includes.size());
@@ -643,14 +662,14 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// retrieve entries by kind
List<ICLanguageSettingEntry> includes = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
+ .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH);
// path0 is taken from higher priority provider
- assertEquals(entriesHigh.get(0),includes.get(0));
+ assertEquals(entriesHigh.get(0), includes.get(0));
// path1 disablement by lower priority provider is ignored
- assertEquals(entriesHigh.get(1),includes.get(1));
+ assertEquals(entriesHigh.get(1), includes.get(1));
// path2 is removed because of DISABLED flag of high priority provider
// path3 gets there from low priority provider
- assertEquals(entriesLow.get(3),includes.get(2));
+ assertEquals(entriesLow.get(3), includes.get(2));
assertEquals(3, includes.size());
}
@@ -663,9 +682,9 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// contribute the entries
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0", 0));
- entries.add(new CMacroEntry("MACRO0", "value0",0));
+ entries.add(new CMacroEntry("MACRO0", "value0", 0));
entries.add(new CIncludePathEntry("path1", 0));
- entries.add(new CMacroEntry("MACRO1", "value1",0));
+ entries.add(new CMacroEntry("MACRO1", "value1", 0));
entries.add(new CIncludePathEntry("path2", 0));
entries.add(new CIncludeFileEntry("include-path-file", 0));
@@ -676,12 +695,12 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
cfgDescription.setLanguageSettingProviders(providers);
// retrieve entries by kind
- List<ICLanguageSettingEntry> result = LanguageSettingsProvidersSerializer
- .getSettingEntriesByKind(cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH | ICSettingEntry.MACRO);
+ List<ICLanguageSettingEntry> result = LanguageSettingsProvidersSerializer.getSettingEntriesByKind(
+ cfgDescription, FILE_0, LANG_ID, ICSettingEntry.INCLUDE_PATH | ICSettingEntry.MACRO);
assertEquals(new CIncludePathEntry("path0", 0), result.get(0));
- assertEquals(new CMacroEntry("MACRO0", "value0",0), result.get(1));
+ assertEquals(new CMacroEntry("MACRO0", "value0", 0), result.get(1));
assertEquals(new CIncludePathEntry("path1", 0), result.get(2));
- assertEquals(new CMacroEntry("MACRO1", "value1",0), result.get(3));
+ assertEquals(new CMacroEntry("MACRO1", "value1", 0), result.get(3));
assertEquals(new CIncludePathEntry("path2", 0), result.get(4));
assertEquals(5, result.size());
}
@@ -693,19 +712,22 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
// Create model project and accompanied descriptions
String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertTrue(cfgDescription instanceof CConfigurationDescription);
// Select a sample workspace provider for the test
- ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider workspaceProvider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
assertNotNull(workspaceProvider);
{
// ensure no test provider is set yet but default providers
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, providers.get(0).getId());
assertEquals(ReferencedProjectsLanguageSettingsProvider.ID, providers.get(1).getId());
assertEquals(ScannerDiscoveryLegacySupport.MBS_LANGUAGE_SETTINGS_PROVIDER_ID, providers.get(2).getId());
@@ -719,7 +741,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
}
{
// check that test provider got there
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(workspaceProvider, providers.get(0));
}
@@ -733,12 +756,14 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// check that test provider got loaded
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
ICConfigurationDescription[] loadedCfgDescriptions = prjDescription.getConfigurations();
ICConfigurationDescription loadedCfgDescription = loadedCfgDescriptions[0];
assertTrue(cfgDescription instanceof CConfigurationDescription);
- List<ILanguageSettingsProvider> loadedProviders = ((ILanguageSettingsProvidersKeeper) loadedCfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> loadedProviders = ((ILanguageSettingsProvidersKeeper) loadedCfgDescription)
+ .getLanguageSettingProviders();
assertTrue(LanguageSettingsManager.isWorkspaceProvider(loadedProviders.get(0)));
}
@@ -749,7 +774,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
*/
public void testWorkspaceProvider_Basic() throws Exception {
// get workspace provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_ID, provider.getId());
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_NAME, provider.getName());
@@ -774,7 +800,7 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
List<ICLanguageSettingEntry> newEntries = new ArrayList<ICLanguageSettingEntry>();
newEntries.add(new CIncludePathEntry("path0", 0));
newEntries.add(new CIncludePathEntry("path1", 0));
- ((LanguageSettingsSerializableProvider)rawProvider).setSettingEntries(null, null, null, newEntries);
+ ((LanguageSettingsSerializableProvider) rawProvider).setSettingEntries(null, null, null, newEntries);
// check that the workspace provider gets them too
List<ICLanguageSettingEntry> newRawEntries = rawProvider.getSettingEntries(null, null, null);
@@ -787,8 +813,10 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
* Test workspace providers equality.
*/
public void testWorkspaceProvider_Equals() throws Exception {
- ILanguageSettingsProvider providerA = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
- ILanguageSettingsProvider providerB = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider providerA = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider providerB = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
assertEquals(providerA, providerB);
}
@@ -797,7 +825,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
*/
public void testWorkspaceProvider_ReplaceRawProvider() throws Exception {
// get sample workspace provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
{
// check on its entries (1 predefined entry via extension point)
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
@@ -813,7 +842,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
{
// replace raw provider
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- LanguageSettingsSerializableProvider newRawProvider = new LanguageSettingsSerializableProvider(EXTENSION_EDITABLE_PROVIDER_ID, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider newRawProvider = new LanguageSettingsSerializableProvider(
+ EXTENSION_EDITABLE_PROVIDER_ID, PROVIDER_NAME_0);
newRawProvider.setSettingEntries(null, null, null, newEntries);
providers.add(newRawProvider);
LanguageSettingsManager.setWorkspaceProviders(providers);
@@ -832,7 +862,8 @@ public class LanguageSettingsManagerTests extends BaseTestCase {
*/
public void testWorkspaceProvider_ReplaceWithWorkspaceProvider() throws Exception {
// get sample workspace provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
assertNotSame(provider, rawProvider);
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java
index e3980125ea8..14fdba97190 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsPersistenceProjectTests.java
@@ -72,22 +72,28 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
/**
* Mock configuration description.
*/
- class MockConfigurationDescription extends CModelMock.DummyCConfigurationDescription implements ILanguageSettingsProvidersKeeper {
+ class MockConfigurationDescription extends CModelMock.DummyCConfigurationDescription
+ implements ILanguageSettingsProvidersKeeper {
List<ILanguageSettingsProvider> providers;
+
public MockConfigurationDescription(String id) {
super(id);
}
+
@Override
public void setLanguageSettingProviders(List<? extends ILanguageSettingsProvider> providers) {
this.providers = new ArrayList<ILanguageSettingsProvider>(providers);
}
+
@Override
public List<ILanguageSettingsProvider> getLanguageSettingProviders() {
return providers;
}
+
@Override
public void setDefaultLanguageSettingsProvidersIds(String[] ids) {
}
+
@Override
public String[] getDefaultLanguageSettingsProvidersIds() {
return null;
@@ -99,17 +105,21 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
*/
class MockProjectDescription extends CModelMock.DummyCProjectDescription {
ICConfigurationDescription[] cfgDescriptions;
+
public MockProjectDescription(ICConfigurationDescription[] cfgDescriptions) {
this.cfgDescriptions = cfgDescriptions;
}
+
public MockProjectDescription(ICConfigurationDescription cfgDescription) {
this.cfgDescriptions = new ICConfigurationDescription[] { cfgDescription };
}
+
@Override
public ICConfigurationDescription[] getConfigurations() {
return cfgDescriptions;
}
+
@Override
public ICConfigurationDescription getConfigurationById(String id) {
for (ICConfigurationDescription cfgDescription : cfgDescriptions) {
@@ -160,7 +170,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
*/
private ICConfigurationDescription[] getConfigurationDescriptions(IProject project) {
// project description
- ICProjectDescription projectDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription projectDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(projectDescription);
assertEquals(1, projectDescription.getConfigurations().length);
// configuration description
@@ -200,7 +211,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -208,11 +220,13 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescriptionWritable);
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> originalProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> originalProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
int originalSize = originalProviders.size();
// create new provider list
- LanguageSettingsSerializableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_0,
+ PROVIDER_NAME_0);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>(originalProviders);
providers.add(mockProvider);
assertTrue(originalSize != providers.size());
@@ -231,7 +245,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// get read-only description
- ICProjectDescription prjDescriptionReadOnly = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescriptionReadOnly = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescriptionReadOnly);
ICConfigurationDescription cfgDescriptionReadOnly = prjDescriptionReadOnly.getDefaultSettingConfiguration();
assertNotNull(cfgDescriptionReadOnly);
@@ -248,7 +263,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// try to write to it default providers ids
try {
- ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly).setDefaultLanguageSettingsProvidersIds(new String[] { PROVIDER_0 });
+ ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly)
+ .setDefaultLanguageSettingsProvidersIds(new String[] { PROVIDER_0 });
fail("WriteAccessException was expected but it was not throw.");
} catch (WriteAccessException e) {
// exception is expected
@@ -260,7 +276,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -269,24 +286,28 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
// create a provider and write to cfgDescription
- LanguageSettingsSerializableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider mockProvider = new MockLanguageSettingsEditableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider, true);
mockProvider.setSettingEntries(cfgDescriptionWritable, null, null, entries);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to cfgDescription default providers ids
- ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setDefaultLanguageSettingsProvidersIds(new String[] { PROVIDER_0 });
+ ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .setDefaultLanguageSettingsProvidersIds(new String[] { PROVIDER_0 });
// apply new project description to the project model
CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescriptionWritable);
}
{
// get read-only project descriptions
- ICProjectDescription prjDescriptionReadOnly = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
+ ICProjectDescription prjDescriptionReadOnly = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, false);
assertNotNull(prjDescriptionReadOnly);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionReadOnly.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -295,7 +316,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescriptionReadOnly instanceof ILanguageSettingsProvidersKeeper);
// double-check providers
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
ILanguageSettingsProvider loadedProvider = providers.get(0);
assertTrue(loadedProvider instanceof MockLanguageSettingsEditableProvider);
@@ -307,12 +329,14 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertEquals(entries.size(), actual.size());
// double-check default providers ids
- String[] actualDefaultProvidersIds = ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly).getDefaultLanguageSettingsProvidersIds();
+ String[] actualDefaultProvidersIds = ((ILanguageSettingsProvidersKeeper) cfgDescriptionReadOnly)
+ .getDefaultLanguageSettingsProvidersIds();
assertTrue(Arrays.equals(new String[] { PROVIDER_0 }, actualDefaultProvidersIds));
}
{
// get writable project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -321,7 +345,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
// check providers
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
ILanguageSettingsProvider loadedProvider = providers.get(0);
assertTrue(loadedProvider instanceof MockLanguageSettingsEditableProvider);
@@ -333,7 +358,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertEquals(entries.size(), actual.size());
// check default providers ids
- String[] actualDefaultProvidersIds = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getDefaultLanguageSettingsProvidersIds();
+ String[] actualDefaultProvidersIds = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getDefaultLanguageSettingsProvidersIds();
assertTrue(Arrays.equals(new String[] { PROVIDER_0 }, actualDefaultProvidersIds));
}
}
@@ -347,8 +373,10 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// get the raw extension provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
- LanguageSettingsSerializableProvider extProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager.getRawProvider(provider);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ LanguageSettingsSerializableProvider extProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager
+ .getRawProvider(provider);
assertNotNull(extProvider);
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_ID, extProvider.getId());
@@ -367,7 +395,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// doublecheck it's clean
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
assertNull(actual);
}
@@ -375,7 +404,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// re-load and check language settings of the provider
LanguageSettingsProvidersSerializer.loadLanguageSettingsWorkspace();
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_ID, provider.getId());
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
assertEquals(entries.get(0), actual.get(0));
@@ -391,12 +421,14 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
extensionEntries.add(EXTENSION_SERIALIZABLE_PROVIDER_ENTRY);
{
// test initial state of the extension provider
- ILanguageSettingsProvider extProvider = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_SERIALIZABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider extProvider = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_SERIALIZABLE_PROVIDER_ID, true);
assertNull(extProvider);
}
{
// get the workspace provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
// check that entries match that of extension provider
assertEquals(extensionEntries, provider.getSettingEntries(null, null, null));
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
@@ -410,7 +442,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
LanguageSettingsProvidersSerializer.loadLanguageSettingsWorkspace();
// ensure the workspace provider still matches extension
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_ID, provider.getId());
assertEquals(extensionEntries, provider.getSettingEntries(null, null, null));
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
@@ -420,7 +453,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(rawProvider instanceof LanguageSettingsSerializableProvider);
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0", 0));
- ((LanguageSettingsSerializableProvider)rawProvider).setSettingEntries(null, null, null, entries);
+ ((LanguageSettingsSerializableProvider) rawProvider).setSettingEntries(null, null, null, entries);
// check that the extension provider is not affected
assertTrue(!LanguageSettingsManager.isEqualExtensionProvider(rawProvider, true));
@@ -433,8 +466,10 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
public void testWorkspacePersistence_GlobalProvider() throws Exception {
{
// get the raw extension provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
- LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager.getRawProvider(provider);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager
+ .getRawProvider(provider);
assertNotNull(rawProvider);
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_ID, rawProvider.getId());
@@ -445,14 +480,17 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// save workspace provider (as opposed to raw provider)
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
providers.add(provider);
LanguageSettingsManager.setWorkspaceProviders(providers);
}
{
// check that it has not cleared
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
- LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager.getRawProvider(provider);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager
+ .getRawProvider(provider);
assertEquals(CUSTOM_PARAMETER, rawProvider.getProperty(ATTR_PARAMETER));
}
}
@@ -463,7 +501,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
public void testWorkspacePersistence_ShadowedExtensionProvider() throws Exception {
{
// get the raw extension provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
// confirm its type and name
assertTrue(rawProvider instanceof LanguageSettingsBaseProvider);
@@ -472,7 +511,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// replace extension provider
- ILanguageSettingsProvider provider = new MockLanguageSettingsSerializableProvider(EXTENSION_BASE_PROVIDER_ID, PROVIDER_NAME_0);
+ ILanguageSettingsProvider provider = new MockLanguageSettingsSerializableProvider(
+ EXTENSION_BASE_PROVIDER_ID, PROVIDER_NAME_0);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(provider);
// note that this will also serialize workspace providers
@@ -480,7 +520,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// doublecheck it's in the list
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
assertTrue(rawProvider instanceof MockLanguageSettingsSerializableProvider);
assertEquals(EXTENSION_BASE_PROVIDER_ID, rawProvider.getId());
@@ -491,7 +532,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// re-load to check serialization
LanguageSettingsProvidersSerializer.loadLanguageSettingsWorkspace();
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
assertTrue(rawProvider instanceof MockLanguageSettingsSerializableProvider);
assertEquals(EXTENSION_BASE_PROVIDER_ID, rawProvider.getId());
@@ -504,7 +546,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// doublecheck original one is in the list
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
assertTrue(rawProvider instanceof LanguageSettingsBaseProvider);
assertEquals(EXTENSION_BASE_PROVIDER_ID, rawProvider.getId());
@@ -514,7 +557,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// re-load to check serialization
LanguageSettingsProvidersSerializer.loadLanguageSettingsWorkspace();
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
assertTrue(rawProvider instanceof LanguageSettingsBaseProvider);
assertEquals(EXTENSION_BASE_PROVIDER_ID, rawProvider.getId());
@@ -533,14 +577,16 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// create a provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- LanguageSettingsSerializableProvider serializableProvider = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider serializableProvider = new LanguageSettingsSerializableProvider(
+ PROVIDER_0, PROVIDER_NAME_0);
serializableProvider.setSettingEntries(null, null, null, entries);
LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, true);
@@ -552,12 +598,14 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
assertTrue(XmlUtil.toString(doc).contains(PROVIDER_0));
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -567,7 +615,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -590,13 +639,15 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// create a provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- ILanguageSettingsProvider provider = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, false);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, false);
assertTrue(provider instanceof MockLanguageSettingsEditableProvider);
MockLanguageSettingsEditableProvider serializableProvider = (MockLanguageSettingsEditableProvider) provider;
serializableProvider.setSettingEntries(null, null, null, entries);
@@ -610,13 +661,15 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
assertTrue(XmlUtil.toString(doc).contains(EXTENSION_EDITABLE_PROVIDER_ID));
assertTrue(XmlUtil.toString(doc).contains(MockLanguageSettingsEditableProvider.class.getName()));
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -626,7 +679,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -651,11 +705,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// create a project description with 2 configuration descriptions
- MockProjectDescription mockPrjDescription = new MockProjectDescription(
- new MockConfigurationDescription[] {
- new MockConfigurationDescription(CFG_ID),
- new MockConfigurationDescription(CFG_ID_2),
- });
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription[] {
+ new MockConfigurationDescription(CFG_ID), new MockConfigurationDescription(CFG_ID_2), });
{
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
assertNotNull(cfgDescriptions);
@@ -667,7 +718,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescription1 instanceof ILanguageSettingsProvidersKeeper);
assertEquals(CFG_ID, cfgDescription1.getId());
- LanguageSettingsSerializableProvider provider1 = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider provider1 = new LanguageSettingsSerializableProvider(
+ PROVIDER_0, PROVIDER_NAME_0);
LanguageSettingsManager.setStoringEntriesInProjectArea(provider1, true);
provider1.setSettingEntries(null, null, null, entries);
ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
@@ -681,7 +733,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescription2 instanceof ILanguageSettingsProvidersKeeper);
assertEquals(CFG_ID_2, cfgDescription2.getId());
- LanguageSettingsSerializableProvider provider2 = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider provider2 = new LanguageSettingsSerializableProvider(
+ PROVIDER_0, PROVIDER_NAME_0);
LanguageSettingsManager.setStoringEntriesInProjectArea(provider2, true);
provider2.setSettingEntries(null, null, null, entries2);
ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
@@ -700,7 +753,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
ICConfigurationDescription cfgDescription1 = cfgDescriptions[0];
assertNotNull(cfgDescription1);
assertTrue(cfgDescription1 instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription1).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription1)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
@@ -716,7 +770,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription2);
assertTrue(cfgDescription2 instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription2).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription2)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -731,15 +786,13 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
}
{
// re-create a project description and re-load language settings for each configuration
- MockProjectDescription mockPrjDescription = new MockProjectDescription(
- new MockConfigurationDescription[] {
- new MockConfigurationDescription(CFG_ID),
- new MockConfigurationDescription(CFG_ID_2),
- });
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription[] {
+ new MockConfigurationDescription(CFG_ID), new MockConfigurationDescription(CFG_ID_2), });
// load
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
@@ -752,7 +805,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription1);
assertTrue(cfgDescription1 instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription1).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription1)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -766,7 +820,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
ICConfigurationDescription cfgDescription2 = cfgDescriptions[1];
assertNotNull(cfgDescription2);
assertTrue(cfgDescription2 instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription2).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription2)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
@@ -790,14 +845,16 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// create a provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- LanguageSettingsSerializableProvider serializableProvider = new MockLanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider serializableProvider = new MockLanguageSettingsSerializableProvider(
+ PROVIDER_0, PROVIDER_NAME_0);
serializableProvider.setSettingEntries(null, null, null, entries);
LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, true);
@@ -809,11 +866,13 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -823,7 +882,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -842,11 +902,13 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Element rootElement = null;
// provider of other type (not LanguageSettingsSerializableProvider) defined as an extension
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
{
// create cfg description
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
@@ -861,11 +923,13 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
}
{
// re-load
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -876,7 +940,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// and check the newly loaded provider which should be workspace provider
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -897,29 +962,32 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(providerExt);
{
// create cfg description
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// populate with provider overriding the extension (must be SerializableLanguageSettingsProvider or a class from another extension)
- MockLanguageSettingsSerializableProvider providerOverride = new MockLanguageSettingsSerializableProvider(idExt, PROVIDER_NAME_0);
+ MockLanguageSettingsSerializableProvider providerOverride = new MockLanguageSettingsSerializableProvider(
+ idExt, PROVIDER_NAME_0);
LanguageSettingsManager.setStoringEntriesInProjectArea(providerOverride, true);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(providerOverride);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
-
// prepare DOM storage
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
}
{
// re-load
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -930,7 +998,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
// check the newly loaded provider
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -941,7 +1010,6 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
}
-
/**
* Test serialization flavors in one storage.
*/
@@ -957,7 +1025,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
ILanguageSettingsProvider providerExt;
{
// Define providers a bunch
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
{
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
@@ -969,11 +1038,13 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// 2. Providers defined in a configuration
// 2.1
- LanguageSettingsSerializableProvider mockProvider1 = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider mockProvider1 = new LanguageSettingsSerializableProvider(
+ PROVIDER_0, PROVIDER_NAME_0);
LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider1, true);
mockProvider1.setSettingEntries(null, null, null, entries_31);
// 2.2
- LanguageSettingsSerializableProvider mockProvider2 = new MockLanguageSettingsSerializableProvider(PROVIDER_2, PROVIDER_NAME_2);
+ LanguageSettingsSerializableProvider mockProvider2 = new MockLanguageSettingsSerializableProvider(
+ PROVIDER_2, PROVIDER_NAME_2);
LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider2, true);
mockProvider2.setSettingEntries(null, null, null, entries_32);
@@ -988,12 +1059,14 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(rootElement, null,
+ mockPrjDescription);
XmlUtil.toString(doc);
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(rootElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -1003,7 +1076,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
// 1. Provider reference to extension from plugin.xml
ILanguageSettingsProvider provider0 = providers.get(0);
@@ -1043,7 +1117,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1052,13 +1127,15 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
// create a provider
- LanguageSettingsSerializableProvider mockProvider = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider mockProvider = new LanguageSettingsSerializableProvider(PROVIDER_0,
+ PROVIDER_NAME_0);
LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider, true);
mockProvider.setSettingEntries(cfgDescriptionWritable, null, null, entries);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
@@ -1070,7 +1147,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
assertTrue(provider instanceof LanguageSettingsSerializableProvider);
@@ -1085,7 +1163,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// Move storage out of the way
String xmlStorageFileLocation = xmlStorageFilePrj.getLocation().toOSString();
java.io.File xmlFile = new java.io.File(xmlStorageFileLocation);
- xmlPrjOutOfTheWay = xmlStorageFileLocation+".out-of-the-way";
+ xmlPrjOutOfTheWay = xmlStorageFileLocation + ".out-of-the-way";
java.io.File xmlFileOut = new java.io.File(xmlPrjOutOfTheWay);
xmlFile.renameTo(xmlFileOut);
assertFalse(xmlFile.exists());
@@ -1093,23 +1171,27 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// Should not pollute workspace area with file with no meaningful data
- String xmlStorageFileWspLocation = getStoreLocationInWorkspaceArea(project.getName()+'.'+LANGUAGE_SETTINGS_WORKSPACE_XML);
+ String xmlStorageFileWspLocation = getStoreLocationInWorkspaceArea(
+ project.getName() + '.' + LANGUAGE_SETTINGS_WORKSPACE_XML);
java.io.File xmlStorageFileWsp = new java.io.File(xmlStorageFileWspLocation);
assertFalse(xmlStorageFileWsp.exists());
}
{
// clear configuration
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
ICConfigurationDescription cfgDescriptionWritable = cfgDescriptions[0];
assertNotNull(cfgDescriptionWritable);
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
- ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(new ArrayList<ILanguageSettingsProvider>());
+ ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .setLanguageSettingProviders(new ArrayList<ILanguageSettingsProvider>());
CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescriptionWritable);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
assertEquals(0, providers.size());
}
{
@@ -1118,7 +1200,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, providers.size());
}
{
@@ -1133,24 +1216,25 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
ICConfigurationDescription cfgDescription = getFirstConfigurationDescription(project);
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, providers.size());
// Move storage back
String xmlStorageFileLocation = xmlStorageFilePrj.getLocation().toOSString();
java.io.File xmlFile = new java.io.File(xmlStorageFileLocation);
xmlFile.delete();
- assertFalse("File "+xmlFile+ " still exist", xmlFile.exists());
+ assertFalse("File " + xmlFile + " still exist", xmlFile.exists());
java.io.File xmlFileOut = new java.io.File(xmlPrjOutOfTheWay);
xmlFileOut.renameTo(xmlFile);
- assertTrue("File "+xmlFile+ " does not exist", xmlFile.exists());
- assertFalse("File "+xmlFileOut+ " still exist", xmlFileOut.exists());
+ assertTrue("File " + xmlFile + " does not exist", xmlFile.exists());
+ assertFalse("File " + xmlFileOut + " still exist", xmlFileOut.exists());
// Wait out in case indexer thread hijacks refreshLocal(), see bug 415970
waitForIndexer(CCorePlugin.getDefault().getCoreModel().create(project));
// Refresh storage in workspace
xmlStorageFilePrj.refreshLocal(IResource.DEPTH_ZERO, null);
- assertTrue("File "+xmlStorageFilePrj+ " does not exist", xmlStorageFilePrj.exists());
+ assertTrue("File " + xmlStorageFilePrj + " does not exist", xmlStorageFilePrj.exists());
// and close
project.close(null);
@@ -1165,7 +1249,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
ILanguageSettingsProvider loadedProvider = providers.get(0);
assertTrue(loadedProvider instanceof LanguageSettingsSerializableProvider);
@@ -1190,14 +1275,16 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// create a provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- LanguageSettingsSerializableProvider serializableProvider = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider serializableProvider = new LanguageSettingsSerializableProvider(
+ PROVIDER_0, PROVIDER_NAME_0);
serializableProvider.setSettingEntries(null, null, null, entries);
// do not store entries inside project
LanguageSettingsManager.setStoringEntriesInProjectArea(serializableProvider, false);
@@ -1212,12 +1299,15 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document wspDoc = XmlUtil.newDocument();
wspStorageElement = XmlUtil.appendElement(wspDoc, ELEM_TEST);
// serialize language settings to the DOM
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(prjStorageElement, wspStorageElement, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(prjStorageElement, wspStorageElement,
+ mockPrjDescription);
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
- LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(prjStorageElement, wspStorageElement, mockPrjDescription);
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
+ LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(prjStorageElement, wspStorageElement,
+ mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
assertNotNull(cfgDescriptions);
@@ -1226,7 +1316,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -1264,7 +1355,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// get project descriptions
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
assertNotNull(prjDescriptionWritable);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
@@ -1273,20 +1365,23 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
// create a provider
- LanguageSettingsSerializableProvider mockProvider = new LanguageSettingsSerializableProvider(PROVIDER_0, PROVIDER_NAME_0);
+ LanguageSettingsSerializableProvider mockProvider = new LanguageSettingsSerializableProvider(PROVIDER_0,
+ PROVIDER_NAME_0);
LanguageSettingsManager.setStoringEntriesInProjectArea(mockProvider, false);
mockProvider.setSettingEntries(cfgDescriptionWritable, null, null, entries);
List<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(mockProvider);
((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(providers);
- List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> storedProviders = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
assertEquals(1, storedProviders.size());
// write to project description
CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescriptionWritable);
xmlStorageFilePrj = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML);
assertTrue(xmlStorageFilePrj.exists());
- xmlStorageFileWspLocation = getStoreLocationInWorkspaceArea(project.getName()+'.'+LANGUAGE_SETTINGS_WORKSPACE_XML);
+ xmlStorageFileWspLocation = getStoreLocationInWorkspaceArea(
+ project.getName() + '.' + LANGUAGE_SETTINGS_WORKSPACE_XML);
java.io.File xmlStorageFileWsp = new java.io.File(xmlStorageFileWspLocation);
assertTrue(xmlStorageFileWsp.exists());
}
@@ -1295,7 +1390,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
assertTrue(provider instanceof LanguageSettingsSerializableProvider);
@@ -1311,7 +1407,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// project storage
String xmlStorageFilePrjLocation = xmlStorageFilePrj.getLocation().toOSString();
java.io.File xmlFile = new java.io.File(xmlStorageFilePrjLocation);
- xmlPrjOutOfTheWay = xmlStorageFilePrjLocation+".out-of-the-way";
+ xmlPrjOutOfTheWay = xmlStorageFilePrjLocation + ".out-of-the-way";
java.io.File xmlFileOut = new java.io.File(xmlPrjOutOfTheWay);
xmlFile.renameTo(xmlFileOut);
assertFalse(xmlFile.exists());
@@ -1320,7 +1416,7 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// workspace storage
java.io.File xmlStorageFileWsp = new java.io.File(xmlStorageFileWspLocation);
assertTrue(xmlStorageFileWsp.exists());
- xmlWspOutOfTheWay = xmlStorageFileWspLocation+".out-of-the-way";
+ xmlWspOutOfTheWay = xmlStorageFileWspLocation + ".out-of-the-way";
java.io.File xmlWspFileOut = new java.io.File(xmlWspOutOfTheWay);
boolean result = xmlStorageFileWsp.renameTo(xmlWspFileOut);
assertTrue(result);
@@ -1330,16 +1426,19 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
{
// clear configuration
- ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance().getProjectDescription(project, true);
+ ICProjectDescription prjDescriptionWritable = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, true);
ICConfigurationDescription[] cfgDescriptions = prjDescriptionWritable.getConfigurations();
assertEquals(1, cfgDescriptions.length);
ICConfigurationDescription cfgDescriptionWritable = cfgDescriptions[0];
assertNotNull(cfgDescriptionWritable);
assertTrue(cfgDescriptionWritable instanceof ILanguageSettingsProvidersKeeper);
- ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).setLanguageSettingProviders(new ArrayList<ILanguageSettingsProvider>());
+ ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .setLanguageSettingProviders(new ArrayList<ILanguageSettingsProvider>());
CProjectDescriptionManager.getInstance().setProjectDescription(project, prjDescriptionWritable);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescriptionWritable)
+ .getLanguageSettingProviders();
assertEquals(0, providers.size());
}
{
@@ -1348,7 +1447,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, providers.size());
}
{
@@ -1363,7 +1463,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
ICConfigurationDescription cfgDescription = getFirstConfigurationDescription(project);
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(0, providers.size());
// Move project storage back
@@ -1371,17 +1472,17 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
String xmlStorageFilePrjLocation = xmlStorageFilePrj.getLocation().toOSString();
java.io.File xmlFile = new java.io.File(xmlStorageFilePrjLocation);
xmlFile.delete();
- assertFalse("File "+xmlFile+ " still exist", xmlFile.exists());
+ assertFalse("File " + xmlFile + " still exist", xmlFile.exists());
java.io.File xmlFileOut = new java.io.File(xmlPrjOutOfTheWay);
xmlFileOut.renameTo(xmlFile);
- assertTrue("File "+xmlFile+ " does not exist", xmlFile.exists());
- assertFalse("File "+xmlFileOut+ " still exist", xmlFileOut.exists());
+ assertTrue("File " + xmlFile + " does not exist", xmlFile.exists());
+ assertFalse("File " + xmlFileOut + " still exist", xmlFileOut.exists());
// Wait out in case indexer thread hijacks refreshLocal(), see bug 415970
waitForIndexer(CCorePlugin.getDefault().getCoreModel().create(project));
// Refresh storage in workspace
xmlStorageFilePrj.refreshLocal(IResource.DEPTH_ZERO, null);
- assertTrue("File "+xmlStorageFilePrj+ " does not exist", xmlStorageFilePrj.exists());
+ assertTrue("File " + xmlStorageFilePrj + " does not exist", xmlStorageFilePrj.exists());
// and close
project.close(null);
@@ -1391,11 +1492,11 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
// Move workspace storage back
java.io.File xmlWspFile = new java.io.File(xmlStorageFileWspLocation);
xmlWspFile.delete();
- assertFalse("File "+xmlWspFile+ " still exist", xmlWspFile.exists());
+ assertFalse("File " + xmlWspFile + " still exist", xmlWspFile.exists());
java.io.File xmlWspFileOut = new java.io.File(xmlWspOutOfTheWay);
xmlWspFileOut.renameTo(xmlWspFile);
- assertTrue("File "+xmlWspFile+ " does not exist", xmlWspFile.exists());
- assertFalse("File "+xmlWspFileOut+ " still exist", xmlWspFileOut.exists());
+ assertTrue("File " + xmlWspFile + " does not exist", xmlWspFile.exists());
+ assertFalse("File " + xmlWspFileOut + " still exist", xmlWspFileOut.exists());
}
{
@@ -1407,7 +1508,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertEquals(1, providers.size());
ILanguageSettingsProvider loadedProvider = providers.get(0);
assertTrue(loadedProvider instanceof LanguageSettingsSerializableProvider);
@@ -1427,25 +1529,27 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
Element storageElement = XmlUtil.appendElement(doc, ELEM_TEST);
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_BASE_PROVIDER_ID);
assertNotNull(providerExt);
{
// create a provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(providerExt);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
// prepare DOM storage
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(storageElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(storageElement, null,
+ mockPrjDescription);
String xml = XmlUtil.toString(doc);
assertTrue(xml.contains(ELEM_PROVIDER_REFERENCE));
@@ -1455,7 +1559,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(storageElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -1465,7 +1570,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -1480,25 +1586,27 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
Document doc = XmlUtil.newDocument();
Element storageElement = XmlUtil.appendElement(doc, ELEM_TEST);
- ILanguageSettingsProvider providerExt = LanguageSettingsManager.getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
+ ILanguageSettingsProvider providerExt = LanguageSettingsManager
+ .getExtensionProviderCopy(EXTENSION_EDITABLE_PROVIDER_ID, true);
assertNotNull(providerExt);
{
// create a provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
-
ArrayList<ILanguageSettingsProvider> providers = new ArrayList<ILanguageSettingsProvider>();
providers.add(providerExt);
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
// prepare DOM storage
- LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(storageElement, null, mockPrjDescription);
+ LanguageSettingsProvidersSerializer.serializeLanguageSettingsInternal(storageElement, null,
+ mockPrjDescription);
String xml = XmlUtil.toString(doc);
assertTrue(xml.contains(ELEM_PROVIDER));
@@ -1508,7 +1616,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// re-load and check language settings of the newly loaded provider
- MockProjectDescription mockPrjDescription = new MockProjectDescription(new MockConfigurationDescription(CFG_ID));
+ MockProjectDescription mockPrjDescription = new MockProjectDescription(
+ new MockConfigurationDescription(CFG_ID));
LanguageSettingsProvidersSerializer.loadLanguageSettingsInternal(storageElement, null, mockPrjDescription);
ICConfigurationDescription[] cfgDescriptions = mockPrjDescription.getConfigurations();
@@ -1518,7 +1627,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
assertNotNull(cfgDescription);
assertTrue(cfgDescription instanceof ILanguageSettingsProvidersKeeper);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertNotNull(providers);
assertEquals(1, providers.size());
ILanguageSettingsProvider provider = providers.get(0);
@@ -1534,7 +1644,8 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
IFile xmlStorageFilePrj = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML);
assertFalse(xmlStorageFilePrj.exists());
- String xmlPrjWspStorageFileLocation = getStoreLocationInWorkspaceArea(project.getName()+'.'+LANGUAGE_SETTINGS_WORKSPACE_XML);
+ String xmlPrjWspStorageFileLocation = getStoreLocationInWorkspaceArea(
+ project.getName() + '.' + LANGUAGE_SETTINGS_WORKSPACE_XML);
java.io.File xmlStorageFilePrjWsp = new java.io.File(xmlPrjWspStorageFileLocation);
assertFalse(xmlStorageFilePrjWsp.exists());
}
@@ -1548,8 +1659,10 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// get extension provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
- LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager.getRawProvider(provider);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_EDITABLE_PROVIDER_ID);
+ LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager
+ .getRawProvider(provider);
assertNotNull(rawProvider);
assertEquals(EXTENSION_EDITABLE_PROVIDER_ID, rawProvider.getId());
@@ -1558,8 +1671,10 @@ public class LanguageSettingsPersistenceProjectTests extends BaseTestCase {
}
{
// get another extension provider
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
- LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager.getRawProvider(provider);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(EXTENSION_SERIALIZABLE_PROVIDER_ID);
+ LanguageSettingsSerializableProvider rawProvider = (LanguageSettingsSerializableProvider) LanguageSettingsManager
+ .getRawProvider(provider);
assertNotNull(rawProvider);
assertEquals(EXTENSION_SERIALIZABLE_PROVIDER_ID, rawProvider.getId());
// modify it and add it to the list
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java
index 99aca640542..d80b4cc9cff 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsProviderReferencedProjectsTests.java
@@ -106,8 +106,13 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
- final ICConfigurationDescription cfgDescriptionReferenced = getConfigurationDescriptions(projectReferenced)[0];
- cfgDescription.setReferenceInfo(new HashMap<String, String>() {{ put(projectReferenced.getName(), cfgDescriptionReferenced.getId()); }});
+ final ICConfigurationDescription cfgDescriptionReferenced = getConfigurationDescriptions(
+ projectReferenced)[0];
+ cfgDescription.setReferenceInfo(new HashMap<String, String>() {
+ {
+ put(projectReferenced.getName(), cfgDescriptionReferenced.getId());
+ }
+ });
coreModel.setProjectDescription(project, projectDescription);
}
@@ -115,7 +120,7 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
// doublecheck that it's set as expected
ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
- Map<String,String> refs = cfgDescription.getReferenceInfo();
+ Map<String, String> refs = cfgDescription.getReferenceInfo();
assertEquals(1, refs.size());
Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet());
assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]);
@@ -127,7 +132,8 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
* Test that null arguments don't crash the provider.
*/
public void testNulls() throws Exception {
- ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
+ ILanguageSettingsProvider provider = LanguageSettingsManager
+ .getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
assertNotNull(provider);
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
assertEquals(null, entries);
@@ -140,8 +146,8 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
// Create model project and accompanied descriptions
String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
- IProject nonReferencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-non-referenced");
- IProject referencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-referenced");
+ IProject nonReferencedProject = ResourceHelper.createCDTProjectWithConfig(projectName + "-non-referenced");
+ IProject referencedProject = ResourceHelper.createCDTProjectWithConfig(projectName + "-referenced");
setReference(project, referencedProject);
// get cfgDescription
@@ -150,24 +156,29 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
{
// double-check that provider for referenced projects is set in the configuration
- ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
+ ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager
+ .getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
assertNotNull(refProjectsProvider);
- List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
+ .getLanguageSettingProviders();
assertTrue(providers.contains(refProjectsProvider));
}
// Check that no setting entries are set initially
{
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription,
+ project, null, ICSettingEntry.ALL);
assertEquals(0, entries.size());
}
// Add an entry into a non-referenced project
- CIncludePathEntry nonRefEntry = CDataUtil.createCIncludePathEntry("non-referenced-exported", ICSettingEntry.EXPORTED);
+ CIncludePathEntry nonRefEntry = CDataUtil.createCIncludePathEntry("non-referenced-exported",
+ ICSettingEntry.EXPORTED);
{
ICConfigurationDescription[] nonRefCfgDescriptions = getConfigurationDescriptions(nonReferencedProject);
ICConfigurationDescription nonRefCfgDescription = nonRefCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersNonRef = ((ILanguageSettingsProvidersKeeper) nonRefCfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providersNonRef = ((ILanguageSettingsProvidersKeeper) nonRefCfgDescription)
+ .getLanguageSettingProviders();
// get user provider which is the first one
ILanguageSettingsProvider userProviderNonRef = providersNonRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderNonRef.getId());
@@ -179,7 +190,8 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
}
// Confirm that that does not add entries to the main project
{
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription,
+ project, null, ICSettingEntry.ALL);
assertEquals(0, entries.size());
}
@@ -188,7 +200,8 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
{
ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(referencedProject);
ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription)
+ .getLanguageSettingProviders();
// get user provider which is the first one
ILanguageSettingsProvider userProviderRef = providersRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
@@ -199,12 +212,14 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
entries.add(refEntry);
entries.add(refEntryNotExported);
((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
- List<ICLanguageSettingEntry> entriesActual = LanguageSettingsManager.getSettingEntriesByKind(refCfgDescription, project, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entriesActual = LanguageSettingsManager
+ .getSettingEntriesByKind(refCfgDescription, project, null, ICSettingEntry.ALL);
assertEquals(entries, entriesActual);
}
// Check that the new entries from referenced project made it to the main project
{
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription,
+ project, null, ICSettingEntry.ALL);
assertEquals(CDataUtil.createCIncludePathEntry(refEntry.getName(), 0), entries.get(0));
assertEquals(1, entries.size());
}
@@ -228,27 +243,34 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
// double-check that provider for referenced projects is set in the configurations
- ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
+ ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager
+ .getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
assertNotNull(refProjectsProvider);
- List<ILanguageSettingsProvider> providersA = ((ILanguageSettingsProvidersKeeper) cfgDescriptionA).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providersA = ((ILanguageSettingsProvidersKeeper) cfgDescriptionA)
+ .getLanguageSettingProviders();
assertTrue(providersA.contains(refProjectsProvider));
- List<ILanguageSettingsProvider> providersB = ((ILanguageSettingsProvidersKeeper) cfgDescriptionB).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providersB = ((ILanguageSettingsProvidersKeeper) cfgDescriptionB)
+ .getLanguageSettingProviders();
assertTrue(providersB.contains(refProjectsProvider));
// Check that no setting entries are set initially
- List<ICLanguageSettingEntry> entriesA = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entriesA = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA,
+ projectA, null, ICSettingEntry.ALL);
assertEquals(0, entriesA.size());
- List<ICLanguageSettingEntry> entriesB = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectB, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entriesB = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA,
+ projectB, null, ICSettingEntry.ALL);
assertEquals(0, entriesB.size());
}
- CIncludePathEntry entryExportedA = CDataUtil.createCIncludePathEntry("referenced-exported-A", ICSettingEntry.EXPORTED);
+ CIncludePathEntry entryExportedA = CDataUtil.createCIncludePathEntry("referenced-exported-A",
+ ICSettingEntry.EXPORTED);
CIncludePathEntry entryNotExportedA = CDataUtil.createCIncludePathEntry("referenced-not-exported-A", 0);
// Add entries into a project A
{
ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectA);
ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription)
+ .getLanguageSettingProviders();
// get user provider which is the first one
ILanguageSettingsProvider userProviderRef = providersRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
@@ -260,13 +282,15 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
}
- CIncludePathEntry entryExportedB = CDataUtil.createCIncludePathEntry("referenced-exported-B", ICSettingEntry.EXPORTED);
+ CIncludePathEntry entryExportedB = CDataUtil.createCIncludePathEntry("referenced-exported-B",
+ ICSettingEntry.EXPORTED);
CIncludePathEntry entryNotExportedB = CDataUtil.createCIncludePathEntry("referenced-not-exported-B", 0);
// Add entries into a project B
{
ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectB);
ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
- List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
+ List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription)
+ .getLanguageSettingProviders();
// get user provider which is the first one
ILanguageSettingsProvider userProviderRef = providersRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
@@ -282,7 +306,8 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
{
ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA,
+ projectA, null, ICSettingEntry.ALL);
assertEquals(entryExportedA, entries.get(0));
assertEquals(entryNotExportedA, entries.get(1));
assertEquals(CDataUtil.createCIncludePathEntry(entryExportedB.getName(), 0), entries.get(2));
@@ -292,7 +317,8 @@ public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCas
{
ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
- List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionB, projectB, null, ICSettingEntry.ALL);
+ List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionB,
+ projectB, null, ICSettingEntry.ALL);
assertEquals(entryExportedB, entries.get(0));
assertEquals(entryNotExportedB, entries.get(1));
assertEquals(CDataUtil.createCIncludePathEntry(entryExportedA.getName(), 0), entries.get(2));
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java
index f2579e0a8a5..14b2ab751a3 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsScannerInfoProviderTests.java
@@ -68,7 +68,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
}
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc,
+ String languageId) {
return entries;
}
}
@@ -127,7 +128,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
}
{
// triplecheck builderCWD for different project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, READ_ONLY);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -156,7 +158,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
{
// Handle prjDescription==null
IProject project = FAKE_FILE.getProject();
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, READ_ONLY);
assertNull(prjDescription);
LanguageSettingsScannerInfoProvider scannerInfoProvider = new LanguageSettingsScannerInfoProvider();
@@ -174,7 +177,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
IFile file = ResourceHelper.createFile(project, "file");
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance()
+ .getProjectDescription(project, READ_ONLY);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -202,7 +206,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
IFile file = ResourceHelper.createFile(project, "file.c");
// confirm that language==null
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, READ_ONLY);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ READ_ONLY);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -224,7 +229,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
public void testRegular() throws Exception {
// create a project
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -245,7 +251,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
CIncludePathEntry includePathEntry = new CIncludePathEntry(includeFolder, 0);
CIncludePathEntry includeLocalPathEntry = new CIncludePathEntry(includeLocalFolder, ICSettingEntry.LOCAL); // #include "..."
- CMacroEntry macroEntry = new CMacroEntry("MACRO", "value",0);
+ CMacroEntry macroEntry = new CMacroEntry("MACRO", "value", 0);
CIncludeFileEntry includeFileEntry = new CIncludeFileEntry(includeFile, 0);
CMacroFileEntry macroFileEntry = new CMacroFileEntry(macroFile, 0);
@@ -296,7 +302,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
public void testLocal() throws Exception {
// create a project
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -350,7 +357,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
public void testFramework() throws Exception {
// create a project
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -393,7 +401,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
public void testDuplicate() throws Exception {
// create a project
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -443,7 +452,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
public void testWorkspacePath() throws Exception {
// create a project
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -470,9 +480,12 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
// contribute the entries
CIncludePathEntry incWorkspaceEntry_1 = new CIncludePathEntry(incWorkspace_1, 0);
- CIncludePathEntry incWorkspaceEntry_2 = new CIncludePathEntry(incWorkspacePath_2, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
- CIncludePathEntry incWorkspaceEntry_3 = new CIncludePathEntry(incWorkspaceRelativePath_3, ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
- CIncludePathEntry incWorkspaceEntry_4 = new CIncludePathEntry(incWorkspacePathNoResolved_4, ICSettingEntry.VALUE_WORKSPACE_PATH);
+ CIncludePathEntry incWorkspaceEntry_2 = new CIncludePathEntry(incWorkspacePath_2,
+ ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ CIncludePathEntry incWorkspaceEntry_3 = new CIncludePathEntry(incWorkspaceRelativePath_3,
+ ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ CIncludePathEntry incWorkspaceEntry_4 = new CIncludePathEntry(incWorkspacePathNoResolved_4,
+ ICSettingEntry.VALUE_WORKSPACE_PATH);
CIncludePathEntry incFilesystemEntry = new CIncludePathEntry(incFilesystem, 0);
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
@@ -514,12 +527,13 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
// change drive on build working directory
String buildCwdDevice = project.getLocation().getDevice();
-// // Test manually with a device which is different from project location device (path should exist)
-// IPath buildCWD = new Path("D:/build/path");
-// String buildCwdDevice = buildCWD.getDevice();
+ // // Test manually with a device which is different from project location device (path should exist)
+ // IPath buildCWD = new Path("D:/build/path");
+ // String buildCwdDevice = buildCWD.getDevice();
// get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -563,15 +577,17 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
IProject project = ResourceHelper.createCDTProjectWithConfig(prjName);
String relativePath = "include";
IFolder buildFolder = ResourceHelper.createFolder(project, "buildDir");
- IFolder relativeFolder = ResourceHelper.createFolder(project, "buildDir/"+relativePath);
- IFolder relativeFolderProjName = ResourceHelper.createFolder(project, "buildDir/"+prjName);
+ IFolder relativeFolder = ResourceHelper.createFolder(project, "buildDir/" + relativePath);
+ IFolder relativeFolderProjName = ResourceHelper.createFolder(project, "buildDir/" + prjName);
String markedResolved = "-MarkedResolved";
- IFolder relativeFolderProjNameResolved = ResourceHelper.createFolder(project, "buildDir/" + prjName+markedResolved);
- IPath buildCWD=buildFolder.getLocation();
+ IFolder relativeFolderProjNameResolved = ResourceHelper.createFolder(project,
+ "buildDir/" + prjName + markedResolved);
+ IPath buildCWD = buildFolder.getLocation();
setBuilderCWD(project, buildCWD);
// get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -583,7 +599,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
// contribute the entries
CIncludePathEntry incRelativeEntry = new CIncludePathEntry(new Path(relativePath), 0);
CIncludePathEntry incProjNameEntry = new CIncludePathEntry(new Path("${ProjName}"), 0);
- CIncludePathEntry incProjNameMarkedResolvedEntry = new CIncludePathEntry(new Path("${ProjName}"+markedResolved), ICSettingEntry.RESOLVED);
+ CIncludePathEntry incProjNameMarkedResolvedEntry = new CIncludePathEntry(
+ new Path("${ProjName}" + markedResolved), ICSettingEntry.RESOLVED);
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(incRelativeEntry);
entries.add(incProjNameEntry);
@@ -612,7 +629,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
assertEquals(new Path(prjName), new Path(actualIncludePaths[3]));
// if marked RESOLVED only that path stays
- assertEquals(new Path("${ProjName}"+markedResolved), new Path(actualIncludePaths[4]));
+ assertEquals(new Path("${ProjName}" + markedResolved), new Path(actualIncludePaths[4]));
assertEquals(5, actualIncludePaths.length);
}
@@ -625,7 +642,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
// set build CWD
IFolder buildFolder = ResourceHelper.createFolder(project, "buildDir");
- IPath buildCWD=buildFolder.getLocation();
+ IPath buildCWD = buildFolder.getLocation();
setBuilderCWD(project, buildCWD);
// define a few variations of paths
@@ -637,11 +654,12 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
String relativePath_dotdot_slash = "../";
String relativePath_dotdot_slash_path = "../include";
IFolder relativeFolder_dotdot_slash_path = ResourceHelper.createFolder(project, "include");
- String locationPath_dotdot_path = buildCWD.toString()+"/../include2";
+ String locationPath_dotdot_path = buildCWD.toString() + "/../include2";
IFolder incFolder_dotdot_slash_path = ResourceHelper.createFolder(project, "include2"); // "/ProjPath/buildDir/../include2"
// get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -652,13 +670,17 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
// contribute the entries
CIncludePathEntry incRelativeEntry_dot = new CIncludePathEntry(new Path(relativePath_dot), 0);
- CIncludePathEntry incRelativeEntry_dot_slash_path = new CIncludePathEntry(new Path(relativePath_dot_slash_path), 0);
+ CIncludePathEntry incRelativeEntry_dot_slash_path = new CIncludePathEntry(new Path(relativePath_dot_slash_path),
+ 0);
CIncludePathEntry incRelativeEntry_dotdot = new CIncludePathEntry(new Path(relativePath_dotdot), 0);
- CIncludePathEntry incRelativeEntry_dotdot_slash_path = new CIncludePathEntry(new Path(relativePath_dotdot_slash_path), 0);
+ CIncludePathEntry incRelativeEntry_dotdot_slash_path = new CIncludePathEntry(
+ new Path(relativePath_dotdot_slash_path), 0);
CIncludePathEntry incEntry_dotdot_path = new CIncludePathEntry(locationPath_dotdot_path, 0);
// use LOCAL flag not to clash with plain dot entries
- CIncludePathEntry incRelativeEntry_dotdot_slash = new CIncludePathEntry(new Path(relativePath_dotdot_slash), ICSettingEntry.LOCAL);
- CIncludePathEntry incRelativeEntry_dot_slash = new CIncludePathEntry(new Path(relativePath_dot_slash), ICSettingEntry.LOCAL);
+ CIncludePathEntry incRelativeEntry_dotdot_slash = new CIncludePathEntry(new Path(relativePath_dotdot_slash),
+ ICSettingEntry.LOCAL);
+ CIncludePathEntry incRelativeEntry_dot_slash = new CIncludePathEntry(new Path(relativePath_dot_slash),
+ ICSettingEntry.LOCAL);
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(incRelativeEntry_dot);
@@ -724,7 +746,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
String envPathStr = "${ProjDirPath}/Folder";
// get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -771,7 +794,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
}
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
if (this.rc.equals(rc))
return entries;
return null;
@@ -780,7 +804,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
// create a project
IProject project = ResourceHelper.createCDTProjectWithConfig(getName());
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -828,7 +853,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
String envPathStr = "${ProjDirPath}/Folder";
// get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
@@ -874,7 +900,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
List<String> languageIds = new ArrayList<String>();
for (ICLanguageSetting ls : langSettings) {
String langId = ls.getLanguageId();
- if (langId!=null && !languageIds.contains(langId)) {
+ if (langId != null && !languageIds.contains(langId)) {
languageIds.add(langId);
}
}
@@ -885,7 +911,7 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
* Test composition of 2 languages.
*/
public void testResourceLanguages() throws Exception {
- class MockProviderLang extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
+ class MockProviderLang extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider {
private final String langId;
private final List<ICLanguageSettingEntry> entries;
@@ -896,8 +922,9 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
}
@Override
- public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
- if (langId==null || langId.equals(languageId))
+ public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription,
+ IResource rc, String languageId) {
+ if (langId == null || langId.equals(languageId))
return entries;
return new ArrayList<ICLanguageSettingEntry>();
}
@@ -912,7 +939,8 @@ public class LanguageSettingsScannerInfoProviderTests extends BaseTestCase {
IFolder incFolderC = ResourceHelper.createFolder(project, "includeC");
// get project/configuration descriptions
- ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project, WRITEABLE);
+ ICProjectDescription prjDescription = CProjectDescriptionManager.getInstance().getProjectDescription(project,
+ WRITEABLE);
assertNotNull(prjDescription);
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
assertNotNull(cfgDescription);
diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java
index c2bfa2c204d..8c2931961e6 100644
--- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java
+++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProviderTests.java
@@ -114,7 +114,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
languages.add(LANG_ID);
// create a provider
- LanguageSettingsSerializableProvider mockProvider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider mockProvider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
// test isEmpty()
assertTrue(mockProvider.isEmpty());
@@ -147,7 +148,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
*/
public void testProvider_SetStoringEntriesInProjectArea() throws Exception {
// create a provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
assertEquals(false, LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true);
@@ -163,7 +165,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create customized provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true);
provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
@@ -194,12 +197,12 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
assertEquals(true, LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
assertEquals(VALUE_PARAMETER, provider.getProperty(ATTR_PARAMETER));
assertNotNull(provider.getLanguageScope());
- assertTrue(provider.getLanguageScope().size()>0);
+ assertTrue(provider.getLanguageScope().size() > 0);
assertEquals(LANG_ID, provider.getLanguageScope().get(0));
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
assertNotNull(entries);
- assertTrue(entries.size()>0);
+ assertTrue(entries.size() > 0);
assertEquals(new CIncludePathEntry("path0", 1), entries.get(0));
}
}
@@ -211,7 +214,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create customized provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true);
provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
@@ -244,7 +248,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
assertEquals(true, LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
assertEquals(VALUE_PARAMETER, provider.getProperty(ATTR_PARAMETER));
assertNotNull(provider.getLanguageScope());
- assertTrue(provider.getLanguageScope().size()>0);
+ assertTrue(provider.getLanguageScope().size() > 0);
assertEquals(LANG_ID, provider.getLanguageScope().get(0));
// no entries should be loaded
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
@@ -259,7 +263,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element rootElement;
{
// create customized provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true);
provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
@@ -287,20 +292,21 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
}
{
// re-load and check language settings of the newly loaded provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_2, PROVIDER_NAME_2);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_2,
+ PROVIDER_NAME_2);
provider.loadEntries(rootElement);
assertEquals(PROVIDER_2, provider.getId());
assertEquals(PROVIDER_NAME_2, provider.getName());
// no attributes should be loaded
assertFalse(PROVIDER_1.equals(provider.getId()));
assertFalse(PROVIDER_NAME_1.equals(provider.getName()));
- assertFalse(true==LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
+ assertFalse(true == LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
assertFalse(VALUE_PARAMETER.equals(provider.getProperty(ATTR_PARAMETER)));
assertNull(provider.getLanguageScope());
// entries should be loaded
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
assertNotNull(entries);
- assertTrue(entries.size()>0);
+ assertTrue(entries.size() > 0);
assertEquals(new CIncludePathEntry("path0", 1), entries.get(0));
}
}
@@ -312,7 +318,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create null provider
- LanguageSettingsSerializableProvider providerNull = new LanguageSettingsSerializableProvider(PROVIDER_NULL, PROVIDER_NAME_NULL);
+ LanguageSettingsSerializableProvider providerNull = new LanguageSettingsSerializableProvider(PROVIDER_NULL,
+ PROVIDER_NAME_NULL);
assertNull(providerNull.getSettingEntries(null, null, null));
// set and get null entries
providerNull.setSettingEntries(null, null, null, null);
@@ -340,7 +347,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create provider with custom parameter
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
assertEquals(VALUE_PARAMETER, provider.getProperty(ATTR_PARAMETER));
@@ -364,7 +372,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create provider storing entries in project area
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
assertEquals(false, LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
LanguageSettingsManager.setStoringEntriesInProjectArea(provider, true);
assertEquals(true, LanguageSettingsManager.isStoringEntriesInProjectArea(provider));
@@ -374,7 +383,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
elementProvider = provider.serialize(rootElement);
String xmlString = XmlUtil.toString(doc);
assertTrue(xmlString.contains(ATTR_STORE_ENTRIES_WITH_PROJECT));
- assertTrue(xmlString.contains(ATTR_STORE_ENTRIES_WITH_PROJECT+"=\"true\""));
+ assertTrue(xmlString.contains(ATTR_STORE_ENTRIES_WITH_PROJECT + "=\"true\""));
}
{
// re-load and check storing mode of the newly loaded provider
@@ -394,7 +403,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create provider with custom language scope
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setLanguageScope(expectedLanguageIds);
List<String> actualIds = provider.getLanguageScope();
assertEquals(LANG_ID, actualIds.get(0));
@@ -434,7 +444,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
{
// create provider with no scope by default
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
// set entries for the whole language scope (now langId=null)
provider.setSettingEntries(null, null, null, entries);
{
@@ -514,7 +525,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, MOCK_RC, LANG_ID, entries);
Document doc = XmlUtil.newDocument();
@@ -544,7 +556,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(MOCK_CFG, MOCK_RC, null, entries);
Document doc = XmlUtil.newDocument();
@@ -564,7 +577,6 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
}
}
-
/**
* Test serialization of entries when language scope is null.
*/
@@ -579,7 +591,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
{
// create a provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
assertEquals(null, provider.getLanguageScope());
// add null language
@@ -651,7 +664,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(MOCK_CFG, null, LANG_ID, entries);
Document doc = XmlUtil.newDocument();
@@ -681,7 +695,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, MOCK_RC, null, entries);
Document doc = XmlUtil.newDocument();
@@ -712,7 +727,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, LANG_ID, entries);
Document doc = XmlUtil.newDocument();
@@ -743,7 +759,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 0));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(MOCK_CFG, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -775,7 +792,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", flag));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -807,7 +825,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludePathEntry("path0", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -823,7 +842,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CIncludePathEntry);
- CIncludePathEntry includePathEntry = (CIncludePathEntry)entry;
+ CIncludePathEntry includePathEntry = (CIncludePathEntry) entry;
assertEquals(entries.get(0).getName(), includePathEntry.getName());
assertEquals(entries.get(0).getValue(), includePathEntry.getValue());
assertEquals(entries.get(0).getKind(), includePathEntry.getKind());
@@ -841,7 +860,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CIncludeFileEntry("a-path", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -856,7 +876,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CIncludeFileEntry);
- CIncludeFileEntry includeFileEntry = (CIncludeFileEntry)entry;
+ CIncludeFileEntry includeFileEntry = (CIncludeFileEntry) entry;
assertEquals(entries.get(0).getName(), includeFileEntry.getName());
assertEquals(entries.get(0).getValue(), includeFileEntry.getValue());
assertEquals(entries.get(0).getKind(), includeFileEntry.getKind());
@@ -871,10 +891,11 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
public void testCMacroEntryDOM() throws Exception {
Element elementProvider;
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
- entries.add(new CMacroEntry("MACRO0", "value0",1));
+ entries.add(new CMacroEntry("MACRO0", "value0", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -889,7 +910,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CMacroEntry);
- CMacroEntry macroEntry = (CMacroEntry)entry;
+ CMacroEntry macroEntry = (CMacroEntry) entry;
assertEquals(entries.get(0).getName(), macroEntry.getName());
assertEquals(entries.get(0).getValue(), macroEntry.getValue());
assertEquals(entries.get(0).getKind(), macroEntry.getKind());
@@ -907,7 +928,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CMacroFileEntry("a-path", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -922,7 +944,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CMacroFileEntry);
- CMacroFileEntry macroFileEntry = (CMacroFileEntry)entry;
+ CMacroFileEntry macroFileEntry = (CMacroFileEntry) entry;
assertEquals(entries.get(0).getName(), macroFileEntry.getName());
assertEquals(entries.get(0).getValue(), macroFileEntry.getValue());
assertEquals(entries.get(0).getKind(), macroFileEntry.getKind());
@@ -940,7 +962,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CLibraryPathEntry("a-path", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -955,7 +978,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CLibraryPathEntry);
- CLibraryPathEntry libraryPathEntry = (CLibraryPathEntry)entry;
+ CLibraryPathEntry libraryPathEntry = (CLibraryPathEntry) entry;
assertEquals(entries.get(0).getName(), libraryPathEntry.getName());
assertEquals(entries.get(0).getValue(), libraryPathEntry.getValue());
assertEquals(entries.get(0).getKind(), libraryPathEntry.getKind());
@@ -973,7 +996,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
entries.add(new CLibraryFileEntry("a-path", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -988,7 +1012,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, null, null);
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CLibraryFileEntry);
- CLibraryFileEntry libraryFileEntry = (CLibraryFileEntry)entry;
+ CLibraryFileEntry libraryFileEntry = (CLibraryFileEntry) entry;
assertEquals(entries.get(0).getName(), libraryFileEntry.getName());
assertEquals(entries.get(0).getValue(), libraryFileEntry.getValue());
assertEquals(entries.get(0).getKind(), libraryFileEntry.getKind());
@@ -1005,10 +1029,11 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0", 1));
entries.add(new CIncludePathEntry("path1", 1));
- entries.add(new CMacroEntry("MACRO0", "value0",1));
+ entries.add(new CMacroEntry("MACRO0", "value0", 1));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -1035,18 +1060,13 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element elementProvider;
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(new CIncludePathEntry("path0",
- ICSettingEntry.BUILTIN
- | ICSettingEntry.READONLY
- | ICSettingEntry.LOCAL
- | ICSettingEntry.VALUE_WORKSPACE_PATH
- | ICSettingEntry.RESOLVED
- | ICSettingEntry.UNDEFINED
- | ICSettingEntry.FRAMEWORKS_MAC
- | ICSettingEntry.EXPORTED
- ));
+ ICSettingEntry.BUILTIN | ICSettingEntry.READONLY | ICSettingEntry.LOCAL
+ | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED | ICSettingEntry.UNDEFINED
+ | ICSettingEntry.FRAMEWORKS_MAC | ICSettingEntry.EXPORTED));
{
// create a provider and serialize its settings
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider.setSettingEntries(null, null, null, entries);
Document doc = XmlUtil.newDocument();
@@ -1062,7 +1082,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
ICLanguageSettingEntry entry = actual.get(0);
assertTrue(entry instanceof CIncludePathEntry);
- CIncludePathEntry includePathEntry = (CIncludePathEntry)entry;
+ CIncludePathEntry includePathEntry = (CIncludePathEntry) entry;
assertEquals(entries.get(0).getName(), includePathEntry.getName());
assertEquals(entries.get(0).getValue(), includePathEntry.getValue());
assertEquals(entries.get(0).getKind(), includePathEntry.getKind());
@@ -1096,7 +1116,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
}
{
// re-load and check language settings of the newly loaded provider
- LanguageSettingsSerializableProvider loadedProvider = new LanguageSettingsSerializableProvider(elementProvider);
+ LanguageSettingsSerializableProvider loadedProvider = new LanguageSettingsSerializableProvider(
+ elementProvider);
List<ICLanguageSettingEntry> actual = loadedProvider.getSettingEntries(null, null, null);
assertEquals(entries.get(0), actual.get(0));
@@ -1131,11 +1152,12 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
elementProvider = mockProvider.serialize(rootElement);
String xml = XmlUtil.toString(elementProvider.getOwnerDocument());
-// fail(xml); // for debugging
+ // fail(xml); // for debugging
}
{
// re-load and check language settings of the newly loaded provider
- LanguageSettingsSerializableProvider loadedProvider = new LanguageSettingsSerializableProvider(elementProvider);
+ LanguageSettingsSerializableProvider loadedProvider = new LanguageSettingsSerializableProvider(
+ elementProvider);
List<ICLanguageSettingEntry> actual = loadedProvider.getSettingEntries(null, null, LANG_ID_1);
assertEquals(entries.get(0), actual.get(0));
@@ -1178,11 +1200,12 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
Element rootElement = XmlUtil.appendElement(doc, ELEM_TEST);
elementProvider = mockProvider.serialize(rootElement);
String xml = XmlUtil.toString(elementProvider.getOwnerDocument());
-// fail(xml); // for debugging
+ // fail(xml); // for debugging
}
{
// re-load and check language settings of the newly loaded provider
- LanguageSettingsSerializableProvider loadedProvider = new LanguageSettingsSerializableProvider(elementProvider);
+ LanguageSettingsSerializableProvider loadedProvider = new LanguageSettingsSerializableProvider(
+ elementProvider);
List<ICLanguageSettingEntry> actual = loadedProvider.getSettingEntries(null, rc1, null);
assertEquals(entries.get(0), actual.get(0));
@@ -1208,7 +1231,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
assertNotNull(emptySettingsPath);
// Create provider
- LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
// store the entries in parent folder
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
@@ -1219,7 +1243,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
{
// retrieve entries for a parent folder itself
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, parentFolder, LANG_ID);
- assertEquals(entries,actual);
+ assertEquals(entries, actual);
assertEquals(entries.size(), actual.size());
}
@@ -1228,14 +1252,15 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
IFile derived = ResourceHelper.createFile(project, "/ParentFolder/Subfolder/resource");
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, derived, LANG_ID);
// NOT taken from parent folder
- assertEquals(null,actual);
+ assertEquals(null, actual);
}
{
// retrieve entries for not related resource
- IFile notRelated = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/AnotherFolder/Subfolder/resource"));
+ IFile notRelated = ResourcesPlugin.getWorkspace().getRoot()
+ .getFile(new Path("/AnotherFolder/Subfolder/resource"));
List<ICLanguageSettingEntry> actual = provider.getSettingEntries(null, notRelated, LANG_ID);
- assertEquals(null,actual);
+ assertEquals(null, actual);
}
{
@@ -1252,7 +1277,7 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
public void testEquals() throws Exception {
// create sample entries
List<ICLanguageSettingEntry> sampleEntries_1 = new ArrayList<ICLanguageSettingEntry>();
- sampleEntries_1.add(new CMacroEntry("MACRO0", "value0",1));
+ sampleEntries_1.add(new CMacroEntry("MACRO0", "value0", 1));
sampleEntries_1.add(new CIncludePathEntry("path0", 1));
sampleEntries_1.add(new CIncludePathEntry("path1", 1));
@@ -1264,7 +1289,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
sampleLanguages.add(LANG_ID);
// create a model provider
- LanguageSettingsSerializableProvider provider1 = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider1 = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
provider1.setLanguageScope(sampleLanguages);
provider1.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
assertEquals(false, LanguageSettingsManager.isStoringEntriesInProjectArea(provider1));
@@ -1273,7 +1299,8 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
provider1.setSettingEntries(null, null, LANG_ID, sampleEntries_2);
// create another provider with the same data
- LanguageSettingsSerializableProvider provider2 = new LanguageSettingsSerializableProvider(PROVIDER_1, PROVIDER_NAME_1);
+ LanguageSettingsSerializableProvider provider2 = new LanguageSettingsSerializableProvider(PROVIDER_1,
+ PROVIDER_NAME_1);
{
provider2.setLanguageScope(sampleLanguages);
provider2.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
@@ -1281,29 +1308,29 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
provider2.setSettingEntries(MOCK_CFG, MOCK_RC, LANG_ID, sampleEntries_1);
provider2.setSettingEntries(null, null, LANG_ID, sampleEntries_2);
// All set now, so they should be equal
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
}
{
// start with provider with the same data
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
// replace languages
List<String> sampleLanguages2 = new ArrayList<String>();
sampleLanguages2.add(LANG_ID_1);
provider2.setLanguageScope(sampleLanguages2);
- assertFalse(provider1.hashCode()==provider2.hashCode());
+ assertFalse(provider1.hashCode() == provider2.hashCode());
assertFalse(provider1.equals(provider2));
// restore provider
provider2.setLanguageScope(sampleLanguages);
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
}
{
// start with provider with the same data
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
// replace property
provider2.setProperty(ATTR_PARAMETER, "changed-parameter");
@@ -1311,12 +1338,12 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
assertFalse(provider1.equals(provider2));
// restore provider
provider2.setProperty(ATTR_PARAMETER, VALUE_PARAMETER);
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
}
{
// start with provider with the same data
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
// replace property
LanguageSettingsManager.setStoringEntriesInProjectArea(provider2, false);
@@ -1324,45 +1351,47 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {
assertFalse(provider1.equals(provider2));
// restore provider
LanguageSettingsManager.setStoringEntriesInProjectArea(provider2, true);
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
}
{
// start with provider with the same data
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
// replace entries
List<ICLanguageSettingEntry> changedEntries = new ArrayList<ICLanguageSettingEntry>();
- changedEntries.add(new CMacroEntry("MACROX", "valueX",1));
+ changedEntries.add(new CMacroEntry("MACROX", "valueX", 1));
provider2.setSettingEntries(MOCK_CFG, MOCK_RC, LANG_ID, changedEntries);
- assertFalse(provider1.hashCode()==provider2.hashCode());
+ assertFalse(provider1.hashCode() == provider2.hashCode());
assertFalse(provider1.equals(provider2));
// restore provider
provider2.setSettingEntries(MOCK_CFG, MOCK_RC, LANG_ID, sampleEntries_1);
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
}
{
// start with provider with the same data
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
// replace default entries
List<ICLanguageSettingEntry> changedEntries = new ArrayList<ICLanguageSettingEntry>();
changedEntries.add(new CIncludePathEntry("pathX", 1));
provider2.setSettingEntries(null, null, LANG_ID, changedEntries);
- assertFalse(provider1.hashCode()==provider2.hashCode());
+ assertFalse(provider1.hashCode() == provider2.hashCode());
assertFalse(provider1.equals(provider2));
// restore provider
provider2.setSettingEntries(null, null, LANG_ID, sampleEntries_2);
- assertTrue(provider1.hashCode()==provider2.hashCode());
+ assertTrue(provider1.hashCode() == provider2.hashCode());
assertTrue(provider1.equals(provider2));
}
{
// check that subclasses are not equal
- LanguageSettingsSerializableProvider providerSub1 = new LanguageSettingsSerializableProvider() {};
- LanguageSettingsSerializableProvider providerSub2 = new LanguageSettingsSerializableProvider() {};
- assertFalse(providerSub1.hashCode()==providerSub2.hashCode());
+ LanguageSettingsSerializableProvider providerSub1 = new LanguageSettingsSerializableProvider() {
+ };
+ LanguageSettingsSerializableProvider providerSub2 = new LanguageSettingsSerializableProvider() {
+ };
+ assertFalse(providerSub1.hashCode() == providerSub2.hashCode());
assertFalse(providerSub1.equals(providerSub2));
}
}
@@ -1372,8 +1401,10 @@ public class LanguageSettingsSerializableProviderTests extends BaseTestCase {</