From 11a4b5c480f9bcb402b93c1e692c0f7e6d19a13a Mon Sep 17 00:00:00 2001 From: olapolus Date: Tue, 21 Jul 2020 19:55:08 +0200 Subject: [PATCH] RED-1433 Drop support for Robot Framework 2.9.x Change-Id: Id638cd2c85bf6edc8c3f66f00041d670bb11c6a2 --- .../build/RobotArtifactsBuilderTest.java | 14 +- .../GeneralSettingsTableValidatorTest.java | 30 -- .../KeywordSettingsValidatorTest.java | 27 -- .../TestCaseSettingsValidatorTest.java | 40 -- .../VersionDependentValidatorsTest.java | 25 +- .../plugin/model/RobotSettingsSection.java | 16 +- .../build/causes/GeneralSettingsProblem.java | 45 --- .../fix/MetadataKeyInSameColumnFixer.java | 89 ----- .../GeneralSettingsTableValidator.java | 12 +- ...alSettingsDuplicationInOldRfValidator.java | 66 ---- ...eyInColumnOfSettingValidatorUntilRF30.java | 54 --- .../SettingsDuplicationInOldRfValidator.java | 56 --- .../VersionDependentValidators.java | 19 +- .../rf/ide/core/environment/RobotVersion.java | 2 +- .../core/execution/debug/KeywordCallType.java | 89 ----- .../execution/debug/StacktraceBuilder.java | 28 +- .../AgentServerVersionsDebugChecker.java | 4 +- .../LocalSettingDeclarationMapper.java | 5 - .../KeywordSettingDeclarationMapperOld.java | 41 --- .../keywords/KeywordTagsMapperOld.java | 25 -- .../keywords/KeywordTagsTagNameMapper.java | 6 - .../setting/SettingDeclarationMapper.java | 18 +- .../SuiteSetupKeywordArgumentMapper.java | 6 - .../SuiteSetupKeywordArgumentMapperOld.java | 24 -- .../suite/SuiteSetupKeywordMapper.java | 6 - .../suite/SuiteSetupKeywordMapperOld.java | 24 -- .../SuiteTeardownKeywordArgumentMapper.java | 6 - ...SuiteTeardownKeywordArgumentMapperOld.java | 24 -- .../suite/SuiteTeardownKeywordMapper.java | 6 - .../suite/SuiteTeardownKeywordMapperOld.java | 24 -- .../test/TestSetupKeywordArgumentMapper.java | 6 - .../TestSetupKeywordArgumentMapperOld.java | 24 -- .../setting/test/TestSetupKeywordMapper.java | 6 - .../test/TestSetupKeywordMapperOld.java | 24 -- .../TestTeardownKeywordArgumentMapper.java | 6 - .../TestTeardownKeywordArgumentMapperOld.java | 24 -- .../test/TestTeardownKeywordMapper.java | 6 - .../test/TestTeardownKeywordMapperOld.java | 24 -- .../mapping/table/SettingsMapperProvider.java | 20 +- .../mapping/table/TestCaseMapperProvider.java | 29 +- .../table/UserKeywordMapperProvider.java | 29 +- .../TestCaseSettingDeclarationMapperOld.java | 40 -- .../table/MultipleSettingsViewsCreator.java | 18 - .../testdata/model/table/SettingTable.java | 50 +-- .../table/setting/views/DefaultTagsView.java | 92 ----- .../table/setting/views/ForceTagsView.java | 92 ----- .../setting/views/SuiteDocumentationView.java | 2 +- .../table/setting/views/SuiteSetupView.java | 100 ----- .../setting/views/SuiteTeardownView.java | 99 ----- .../table/setting/views/TestSetupView.java | 99 ----- .../table/setting/views/TestTeardownView.java | 99 ----- .../table/setting/views/TestTemplateView.java | 99 ----- .../table/setting/views/TestTimeoutView.java | 98 ----- .../text/read/TextualRobotFileParser.java | 4 +- .../text/read/recognizer/RobotTokenType.java | 6 +- .../SettingsRecognizersProvider.java | 3 +- .../KeywordPostconditionRecognizer.java | 4 +- .../keywords/KeywordTagsRecognizer.java | 2 +- .../recognizer/settings/MetaRecognizer.java | 31 -- .../src/main/python/scripts/red_libraries.py | 9 +- .../src/main/python/scripts/red_variables.py | 27 +- .../core/environment/RobotVersionTest.java | 4 +- .../execution/debug/KeywordCallTypeTest.java | 343 +----------------- .../debug/StacktraceBuilderTest.java | 23 -- .../AgentServerVersionsDebugCheckerTest.java | 4 +- ...botParserSimpleExecutableContinueTest.java | 6 +- .../rf/ide/core/testdata/RobotParserTest.java | 31 +- .../testdata/TrashCommentsParsingTest.java | 2 +- ...tationCacherInsideRobotFileOutputTest.java | 4 +- .../update/KeywordTableModelUpdaterTest.java | 2 +- .../update/SettingTableModelUpdaterTest.java | 2 +- .../model/table/SettingTableTest.java | 23 -- ...eAsExecutableRowDescriptorBuilderTest.java | 8 +- .../UserKeywordRemoveElementsTest.java | 2 +- ...TagsViewTest.java => DefaultTagsTest.java} | 254 +++++++------ ...ceTagsViewTest.java => ForceTagsTest.java} | 254 +++++++------ .../{views => }/ModelTokenTestHelper.java | 2 +- ...SetupViewTest.java => SuiteSetupTest.java} | 290 ++++++++------- ...wnViewTest.java => SuiteTeardownTest.java} | 233 ++++++------ ...tSetupViewTest.java => TestSetupTest.java} | 233 ++++++------ ...ownViewTest.java => TestTeardownTest.java} | 233 ++++++------ .../model/table/setting/TestTimeoutTest.java | 128 ++++++- .../views/SuiteDocumentationViewTest.java | 8 +- .../setting/views/TestTimeoutViewTest.java | 122 ------- .../testcases/TestCaseRemoveElementsTest.java | 2 +- ...tinueForItemIssueFixerOutputCheckTest.java | 2 +- .../settings/MetaRecognizerTest.java | 104 ------ .../write/TestCaseNotChangedDumperTest.java | 4 +- .../CreationOfKeywordArgumentsTest.java | 10 +- .../CreationOfKeywordDocumentationTest.java | 12 +- ...reationOfKeywordExecutableOneStepTest.java | 2 +- ...tionOfKeywordExecutableThreeStepsTest.java | 2 +- .../creation/CreationOfKeywordReturnTest.java | 10 +- .../CreationOfKeywordTableHeaderTest.java | 10 +- .../creation/CreationOfKeywordTagsTest.java | 10 +- .../CreationOfKeywordTeardownTest.java | 14 +- .../CreationOfKeywordTimeoutTest.java | 14 +- ...hreeKeywordExecutablesWithOneStepTest.java | 2 +- .../CreationOfSettingTableHeaderTest.java | 10 +- .../CreationOfSettingsDefaultTagsTest.java | 10 +- .../CreationOfSettingsForceTagsTest.java | 10 +- .../CreationOfSettingsLibraryImportTest.java | 16 +- .../CreationOfSettingsMetadataTest.java | 14 +- .../CreationOfSettingsResourceImportTest.java | 10 +- ...ationOfSettingsSuiteDocumentationTest.java | 12 +- .../CreationOfSettingsSuiteSetupTest.java | 14 +- .../CreationOfSettingsSuiteTeardownTest.java | 14 +- .../CreationOfSettingsTaskTemplateTest.java | 4 +- .../CreationOfSettingsTaskTimeoutTest.java | 4 +- .../CreationOfSettingsTestSetupTest.java | 14 +- .../CreationOfSettingsTestTeardownTest.java | 14 +- .../CreationOfSettingsTestTemplateTest.java | 14 +- .../CreationOfSettingsTestTimeoutTest.java | 14 +- ...CreationOfSettingsVariablesImportTest.java | 14 +- .../UpdateOfSettingsSuiteSetupTest.java | 32 +- .../CreationOfTestCaseDocumentationTest.java | 12 +- ...eationOfTestCaseExecutableOneStepTest.java | 4 +- ...ionOfTestCaseExecutableThreeStepsTest.java | 4 +- .../creation/CreationOfTestCaseSetupTest.java | 14 +- .../CreationOfTestCaseTableHeaderTest.java | 10 +- .../creation/CreationOfTestCaseTagsTest.java | 10 +- .../CreationOfTestCaseTeardownTest.java | 14 +- .../CreationOfTestCaseTemplateTest.java | 14 +- .../CreationOfTestCaseTimeoutTest.java | 14 +- ...reeTestCaseExecutablesWithOneStepTest.java | 4 +- .../CreationOfDictionaryVariableTest.java | 14 +- .../creation/CreationOfListVariableTest.java | 18 +- .../CreationOfScalarVariableTest.java | 16 +- .../CreationOfVariableTableHeaderTest.java | 10 +- ...iewUpdatedByArgInNotExistingPosition.robot | 3 +- ...nViewUpdatedByArgInNotExistingPosition.tsv | 3 +- 131 files changed, 1283 insertions(+), 3513 deletions(-) delete mode 100644 src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/fix/MetadataKeyInSameColumnFixer.java delete mode 100644 src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/LocalSettingsDuplicationInOldRfValidator.java delete mode 100644 src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/MetadataKeyInColumnOfSettingValidatorUntilRF30.java delete mode 100644 src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/SettingsDuplicationInOldRfValidator.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordSettingDeclarationMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordArgumentMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/testcases/TestCaseSettingDeclarationMapperOld.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTemplateView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutView.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizer.java rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views/DefaultTagsViewTest.java => DefaultTagsTest.java} (63%) rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views/ForceTagsViewTest.java => ForceTagsTest.java} (61%) rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views => }/ModelTokenTestHelper.java (91%) rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views/SuiteSetupViewTest.java => SuiteSetupTest.java} (60%) rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views/SuiteTeardownViewTest.java => SuiteTeardownTest.java} (59%) rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views/TestSetupViewTest.java => TestSetupTest.java} (59%) rename src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/{views/TestTeardownViewTest.java => TestTeardownTest.java} (59%) delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutViewTest.java delete mode 100644 src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizerTest.java diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/RobotArtifactsBuilderTest.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/RobotArtifactsBuilderTest.java index c01482904..ae2db3ba5 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/RobotArtifactsBuilderTest.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/RobotArtifactsBuilderTest.java @@ -108,7 +108,7 @@ public void missingRobotProblemIsReported() throws Exception { public void deprecatedRobotProblemIsReported_whenPythonInstallationIsNotDeprecated() throws Exception { final RobotProject robotProject = spy(model.createRobotProject(project)); final IRuntimeEnvironment env = new RobotRuntimeEnvironment(null, - "Robot Framework 2.8.2 (Python 2.7.1 on win32)"); + "Robot Framework 2.9.2 (Python 2.7.1 on win32)"); builder.checkRuntimeEnvironment(env, robotProject, reporter); assertThat(reporter.getReportedProblems()).containsExactly( @@ -119,23 +119,13 @@ public void deprecatedRobotProblemIsReported_whenPythonInstallationIsNotDeprecat public void deprecatedRobotProblemIsReported_whenPythonInstallationIsDeprecated() throws Exception { final RobotProject robotProject = spy(model.createRobotProject(project)); final IRuntimeEnvironment env = new RobotRuntimeEnvironment(null, - "Robot Framework 2.8.2 (Python 2.6.1 on win32)"); + "Robot Framework 2.9.2 (Python 2.6.1 on win32)"); builder.checkRuntimeEnvironment(env, robotProject, reporter); assertThat(reporter.getReportedProblems()).containsExactly( new Problem(ProjectConfigurationProblem.ENVIRONMENT_DEPRECATED_ROBOT, new ProblemPosition(1))); } - @Test - public void noProblemsAreReported_whenRobotInstallationIsNotDeprecated() throws Exception { - final RobotProject robotProject = spy(model.createRobotProject(project)); - final IRuntimeEnvironment env = new RobotRuntimeEnvironment(null, - "Robot Framework 2.9 (Python 2.7.1 on win32)"); - builder.checkRuntimeEnvironment(env, robotProject, reporter); - - assertThat(reporter.getReportedProblems()).isEmpty(); - } - @Test public void deprecatedPythonProblemIsReported() throws Exception { final RobotProject robotProject = spy(model.createRobotProject(project)); diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidatorTest.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidatorTest.java index 58e819fd1..dfbab1e10 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidatorTest.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidatorTest.java @@ -451,19 +451,6 @@ public void declaredVariableInTimeoutIsNotReported() throws CoreException { assertThat(problems).isEmpty(); } - @Test - public void documentSettingIsNotReported_whenRobotIsOld() throws CoreException { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile file = new RobotSuiteFileCreator(version).appendLine("*** Settings ***") - .appendLine("Document doc") - .build(); - - final FileValidationContext context = prepareContext(version); - final Collection problems = validate(context, file); - - assertThat(problems).isEmpty(); - } - @Test public void documentSettingIsReportedToBeDeprecated_whenRobotIs30() throws CoreException { final RobotVersion version = new RobotVersion(3, 0); @@ -493,23 +480,6 @@ public void documentSettingIsUnknown_whenRobotIs31() throws CoreException { new Problem(GeneralSettingsProblem.UNKNOWN_SETTING, new ProblemPosition(2, Range.closed(17, 25)))); } - @Test - public void outdatedSetupAndTeardownSyntaxAreNotReported_whenRobotIsOld() throws CoreException { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile file = new RobotSuiteFileCreator(version).appendLine("*** Settings ***") - .appendLine("Suite Precondition kw") - .appendLine("Suite Postcondition kw") - .appendLine("Test Precondition kw") - .appendLine("Test Postcondition kw") - .build(); - - final List accessibleKws = newArrayList(newResourceKeyword("kw", new Path("/file.robot"))); - final FileValidationContext context = prepareContext(accessibleKws, version); - final Collection problems = validate(context, file); - - assertThat(problems).isEmpty(); - } - @Test public void outdatedSetupAndTeardownSyntaxAreReportedToBeDeprecated_whenRobotIs30() throws CoreException { final RobotVersion version = new RobotVersion(3, 0); diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/KeywordSettingsValidatorTest.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/KeywordSettingsValidatorTest.java index 65e6229e1..79951957a 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/KeywordSettingsValidatorTest.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/KeywordSettingsValidatorTest.java @@ -173,18 +173,6 @@ public void duplicatedDocumentationsAreReportedInRf3() { new Problem(GeneralSettingsProblem.DUPLICATED_SETTING, new ProblemPosition(4, Range.closed(53, 68)))); } - @Test - public void documentSettingIsNotReported_inOlderRobot() { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile fileModel = new RobotSuiteFileCreator(version).appendLine("*** Keywords ***") - .appendLine("keyword") - .appendLine(" [Document] doc1") - .build(); - - final Collection problems = validate(prepareContext(version), fileModel); - assertThat(problems).isEmpty(); - } - @Test public void documentSettingIsReportedAsDeprecated_inRf3() { final RobotVersion version = new RobotVersion(3, 0); @@ -326,21 +314,6 @@ public void duplicatedTeardownsAreReportedInRf3() { new Problem(GeneralSettingsProblem.DUPLICATED_SETTING, new ProblemPosition(4, Range.closed(46, 56)))); } - @Test - public void postconditionSettingIsNotRecognized_inOlderRobot() { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile fileModel = new RobotSuiteFileCreator(version).appendLine("*** Keywords ***") - .appendLine("kw") - .appendLine(" [Postcondition] keyword") - .build(); - - final List accessibleKws = newArrayList(newResourceKeyword("keyword", new Path("/file.robot"))); - - final Collection problems = validate(prepareContext(accessibleKws, version), fileModel); - assertThat(problems).containsOnly( - new Problem(KeywordsProblem.UNKNOWN_KEYWORD_SETTING, new ProblemPosition(3, Range.closed(22, 37)))); - } - @Test public void postconditionSettingIsReportedAsDeprecated_inRf30() { final RobotVersion version = new RobotVersion(3, 0); diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/TestCaseSettingsValidatorTest.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/TestCaseSettingsValidatorTest.java index 87ab8af48..90655ec32 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/TestCaseSettingsValidatorTest.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/TestCaseSettingsValidatorTest.java @@ -147,18 +147,6 @@ public void duplicatedDocumentationsAreReportedInRf3() throws CoreException { new Problem(GeneralSettingsProblem.DUPLICATED_SETTING, new ProblemPosition(4, Range.closed(52, 67)))); } - @Test - public void documentSettingIsNotReported_inOlderRobot() throws CoreException { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile fileModel = new RobotSuiteFileCreator(version).appendLine("*** Test Cases ***") - .appendLine("case") - .appendLine(" [Document] doc1") - .build(); - - final Collection problems = validate(prepareContext(version), fileModel); - assertThat(problems).isEmpty(); - } - @Test public void documentSettingIsReportedAsDeprecated_inRf30() throws CoreException { final RobotVersion version = new RobotVersion(3, 0); @@ -425,20 +413,6 @@ public void duplicatedSetupsAreReportedInRf3() throws CoreException { new Problem(GeneralSettingsProblem.DUPLICATED_SETTING, new ProblemPosition(4, Range.closed(47, 54)))); } - @Test - public void preconditionSettingIsNotReported_inOlderRobot() throws CoreException { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile fileModel = new RobotSuiteFileCreator(version).appendLine("*** Test Cases ***") - .appendLine("case") - .appendLine(" [Precondition] keyword") - .build(); - - final List accessibleKws = newArrayList(newResourceKeyword("keyword", new Path("/file.robot"))); - - final Collection problems = validate(prepareContext(accessibleKws, version), fileModel); - assertThat(problems).isEmpty(); - } - @Test public void preconditionSettingIsReportedAsDeprecated_inRf30() throws CoreException { final RobotVersion version = new RobotVersion(3, 0); @@ -516,20 +490,6 @@ public void duplicatedTeardownsAreReportedInRf3() throws CoreException { new Problem(GeneralSettingsProblem.DUPLICATED_SETTING, new ProblemPosition(4, Range.closed(50, 60)))); } - @Test - public void postconditionSettingIsNotReported_forOlderRobot() throws CoreException { - final RobotVersion version = new RobotVersion(2, 9); - final RobotSuiteFile fileModel = new RobotSuiteFileCreator(version).appendLine("*** Test Cases ***") - .appendLine("case") - .appendLine(" [Postcondition] keyword") - .build(); - - final List accessibleKws = newArrayList(newResourceKeyword("keyword", new Path("/file.robot"))); - - final Collection problems = validate(prepareContext(accessibleKws, version), fileModel); - assertThat(problems).isEmpty(); - } - @Test public void postconditionSettingIsReportedAsDeprecated_inRf30() throws CoreException { final RobotVersion version = new RobotVersion(3, 0); diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidatorsTest.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidatorsTest.java index 69998325b..24bfe7fc1 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidatorsTest.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin.tests/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidatorsTest.java @@ -34,18 +34,9 @@ public class VersionDependentValidatorsTest { public static class GeneralSettingsTableValidatorsTest { @Test - public void properValidatorsAreReturnedForVersionUnder29() { - assertThat(getGeneralSettingsTableValidators("2.8.0")).hasSize(11) - .hasOnlyElementsOfTypes(SettingsDuplicationInOldRfValidator.class, - TemplateSettingUntilRf31Validator.class); - } - - @Test - public void properValidatorsAreReturnedForVersion29() { - assertThat(getGeneralSettingsTableValidators("2.9")).hasSize(12) - .hasOnlyElementsOfTypes(SettingsDuplicationInOldRfValidator.class, - MetadataKeyInColumnOfSettingValidatorUntilRF30.class, - TemplateSettingUntilRf31Validator.class); + public void properValidatorsAreReturnedForVersionUnder30() { + assertThat(getGeneralSettingsTableValidators("2.9")).hasSize(2) + .hasOnlyElementsOfTypes(TemplateSettingUntilRf31Validator.class); } @Test @@ -157,9 +148,8 @@ public static class TestCaseSettingsValidatorsTest { @Test public void properValidatorsAreReturnedForVersionUnder30() { - assertThat(getTestCaseSettingsValidators("2.9")).hasSize(2) - .hasOnlyElementsOfTypes(LocalSettingsDuplicationInOldRfValidator.class, - TemplateSettingUntilRf31Validator.class); + assertThat(getTestCaseSettingsValidators("2.9")).hasSize(1) + .hasOnlyElementsOfTypes(TemplateSettingUntilRf31Validator.class); } @Test @@ -284,9 +274,8 @@ private Stream getTaskSettingsValidators(fin public static class KeywordSettingsValidatorsTest { @Test - public void properValidatorsAreReturnedForVersionUnder30() { - assertThat(getKeywordSettingsValidators("2.9")).hasSize(1) - .hasOnlyElementsOfTypes(LocalSettingsDuplicationInOldRfValidator.class); + public void noValidatorsAreReturnedForVersionUnder30() { + assertThat(getKeywordSettingsValidators("2.9")).isEmpty(); } @Test diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/model/RobotSettingsSection.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/model/RobotSettingsSection.java index cb4b0b60f..62e51cc8b 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/model/RobotSettingsSection.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/model/RobotSettingsSection.java @@ -73,13 +73,13 @@ public void link() { for (final ATags tagSetting : getTagsSettings(settingsTable)) { elements.add(new RobotSetting(this, tagSetting)); } - for (final TestTemplate templateSetting : settingsTable.getTestTemplatesViews()) { + for (final TestTemplate templateSetting : settingsTable.getTestTemplates()) { elements.add(new RobotSetting(this, templateSetting)); } for (final TaskTemplate templateSetting : settingsTable.getTaskTemplates()) { elements.add(new RobotSetting(this, templateSetting)); } - for (final TestTimeout timeoutSetting : settingsTable.getTestTimeoutsViews()) { + for (final TestTimeout timeoutSetting : settingsTable.getTestTimeouts()) { elements.add(new RobotSetting(this, timeoutSetting)); } for (final TaskTimeout timeoutSetting : settingsTable.getTaskTimeouts()) { @@ -242,11 +242,11 @@ private static List getImportPaths(final List importSettin private static List> getKeywordBasedSettings(final SettingTable settingTable) { final List> elements = new ArrayList<>(); - settingTable.getSuiteSetupsViews().stream().findFirst().ifPresent(elements::add); - settingTable.getSuiteTeardownsViews().stream().findFirst().ifPresent(elements::add); - settingTable.getTestSetupsViews().stream().findFirst().ifPresent(elements::add); + settingTable.getSuiteSetups().stream().findFirst().ifPresent(elements::add); + settingTable.getSuiteTeardowns().stream().findFirst().ifPresent(elements::add); + settingTable.getTestSetups().stream().findFirst().ifPresent(elements::add); settingTable.getTaskSetups().stream().findFirst().ifPresent(elements::add); - settingTable.getTestTeardownsViews().stream().findFirst().ifPresent(elements::add); + settingTable.getTestTeardowns().stream().findFirst().ifPresent(elements::add); settingTable.getTaskTeardowns().stream().findFirst().ifPresent(elements::add); return elements; @@ -255,8 +255,8 @@ private static List> getKeywordBasedSettings(fi private static List> getTagsSettings(final SettingTable settingTable) { final List> elements = new ArrayList<>(); - settingTable.getForceTagsViews().forEach(elements::add); - settingTable.getDefaultTagsViews().forEach(elements::add); + settingTable.getForceTags().forEach(elements::add); + settingTable.getDefaultTags().forEach(elements::add); return elements; } diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/causes/GeneralSettingsProblem.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/causes/GeneralSettingsProblem.java index 32e5bd6eb..a4bb53360 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/causes/GeneralSettingsProblem.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/causes/GeneralSettingsProblem.java @@ -39,7 +39,6 @@ import org.robotframework.ide.eclipse.main.plugin.project.build.fix.CreateResourceFileFixer; import org.robotframework.ide.eclipse.main.plugin.project.build.fix.DefineGlobalVariableInConfigFixer; import org.robotframework.ide.eclipse.main.plugin.project.build.fix.JoinTemplateNameFixer; -import org.robotframework.ide.eclipse.main.plugin.project.build.fix.MetadataKeyInSameColumnFixer; import org.robotframework.ide.eclipse.main.plugin.project.build.fix.RemoveSettingFixer; import org.robotframework.ide.eclipse.main.plugin.project.build.fix.RemoveSettingValuesExceptFirstFixer; @@ -141,28 +140,6 @@ public List createFixers(final IMarker marker) { return newArrayList(new RemoveSettingFixer()); } }, - DUPLICATED_SETTING_OLD { - - @Override - public ProblemCategory getProblemCategory() { - return ProblemCategory.DEPRECATED_API; - } - - @Override - public String getProblemDescription() { - return "Setting '%s' is duplicated. Line continuation (...) should be used instead"; - } - - @Override - public boolean hasResolution() { - return true; - } - - @Override - public List createFixers(final IMarker marker) { - return newArrayList(new ChangeToFixer("...")); - } - }, INVALID_NUMBER_OF_SETTING_VALUES { @Override @@ -571,28 +548,6 @@ public List createFixers(final IMarker marker) { return newArrayList(new RemoveSettingValuesExceptFirstFixer("Remove Test Timeout message")); } }, - METADATA_SETTING_JOINED_WITH_KEY_IN_COLUMN_29 { - - @Override - public ProblemCategory getProblemCategory() { - return ProblemCategory.DEPRECATED_API; - } - - @Override - public String getProblemDescription() { - return "Setting metadata using key in first column syntax is deprecated in RF 2.9 and removed in RF 3.0"; - } - - @Override - public boolean hasResolution() { - return true; - } - - @Override - public List createFixers(final IMarker marker) { - return newArrayList(new MetadataKeyInSameColumnFixer()); - } - }, DEPRECATED_SETTING_NAME { @Override diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/fix/MetadataKeyInSameColumnFixer.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/fix/MetadataKeyInSameColumnFixer.java deleted file mode 100644 index 1e67a0ecc..000000000 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/fix/MetadataKeyInSameColumnFixer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.robotframework.ide.eclipse.main.plugin.project.build.fix; - -import java.util.List; -import java.util.Optional; - -import javax.swing.text.BadLocationException; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.rf.ide.core.testdata.model.table.setting.Metadata; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; -import org.robotframework.ide.eclipse.main.plugin.RedImages; -import org.robotframework.ide.eclipse.main.plugin.model.RobotSetting; -import org.robotframework.ide.eclipse.main.plugin.model.RobotSettingsSection; -import org.robotframework.ide.eclipse.main.plugin.model.RobotSuiteFile; -import org.robotframework.ide.eclipse.main.plugin.project.build.RobotProblem; -import org.robotframework.ide.eclipse.main.plugin.tableeditor.source.assist.RedCompletionBuilder; -import org.robotframework.ide.eclipse.main.plugin.tableeditor.source.assist.RedCompletionProposal; -import org.robotframework.red.graphics.ImagesManager; - -import com.google.common.collect.Range; - -public class MetadataKeyInSameColumnFixer extends RedSuiteMarkerResolution { - - // Splits old syntax: - // *** Settings *** - // Meta: key val - // - // into : - // *** Settings *** - // Metadata key val - - @Override - public String getLabel() { - return "Split Metadata key from setting declaration"; - } - - @Override - public Optional asContentProposal(final IMarker marker, final IDocument document, - final RobotSuiteFile suiteModel) { - final Optional section = suiteModel.findSection(RobotSettingsSection.class); - if (section.isPresent()) { - final Range range = RobotProblem.getRangeOf(marker); - final List metadataSettings = section.get().getMetadataSettings(); - for (final RobotSetting metadataSetting : metadataSettings) { - if (range.contains(metadataSetting.getDefinitionPosition().getOffset())) { - try { - return createProposal(document, suiteModel, metadataSetting); - } catch (final BadLocationException e) { - return Optional.empty(); - } - } - } - } - return Optional.empty(); - } - - private Optional createProposal(final IDocument document, final RobotSuiteFile suiteModel, - final RobotSetting metadataSetting) throws BadLocationException { - - final Metadata metadata = (Metadata) metadataSetting.getLinkedElement(); - final RobotToken declaration = metadata.getDeclaration(); - final int offset = declaration.getStartOffset(); - - final IRegion toChange = new Region(offset, metadata.getKey().getEndOffset() - offset); - final String cellSeparator = getSeparator(suiteModel, offset); - - final String correctedMetadata = "Metadata" + cellSeparator + metadata.getKey().getText(); - - final String info = Snippets.createSnippetInfo(document, toChange, correctedMetadata); - final RedCompletionProposal proposal = RedCompletionBuilder.newProposal() - .willPut(correctedMetadata) - .byReplacingRegion(toChange) - .secondaryPopupShouldBeDisplayedUsingHtml(info) - .thenCursorWillStopAtTheEndOfInsertion() - .displayedLabelShouldBe(getLabel()) - .proposalsShouldHaveIcon(ImagesManager.getImage(RedImages.getRobotSettingImage())) - .create(); - return Optional.of(proposal); - } -} diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidator.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidator.java index 5fd6518ea..ed97583d2 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidator.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/GeneralSettingsTableValidator.java @@ -96,8 +96,8 @@ public void validate(final IProgressMonitor monitor) throws CoreException { validateSetupsAndTeardowns(settingsTable.getTestTeardowns()); validateSetupsAndTeardowns(settingsTable.getTaskSetups()); validateSetupsAndTeardowns(settingsTable.getTaskTeardowns()); - validateTemplates(settingsTable.getTestTemplatesViews(), settingsTable.getTaskTemplates()); - validateTestTimeouts(settingsTable.getTestTimeoutsViews()); + validateTemplates(settingsTable.getTestTemplates(), settingsTable.getTaskTemplates()); + validateTestTimeouts(settingsTable.getTestTimeouts()); validateTaskTimeouts(settingsTable.getTaskTimeouts()); validateTags(settingsTable.getDefaultTags()); validateTags(settingsTable.getForceTags()); @@ -260,10 +260,10 @@ private void validateKeywordsAndVariablesUsagesInExecutables(final SettingTable final Set additionalVariables = new HashSet<>(); final List execValidators = new ArrayList<>(); - for (final SuiteSetup suiteSetup : settingsTable.getSuiteSetupsViews()) { + for (final SuiteSetup suiteSetup : settingsTable.getSuiteSetups()) { execValidators.add(ExecutableValidator.of(validationContext, additionalVariables, suiteSetup, reporter)); } - for (final TestSetup testSetup : settingsTable.getTestSetupsViews()) { + for (final TestSetup testSetup : settingsTable.getTestSetups()) { execValidators.add(ExecutableValidator.of(validationContext, additionalVariables, testSetup, reporter)); } for (final TaskSetup taskSetup : settingsTable.getTaskSetups()) { @@ -272,10 +272,10 @@ private void validateKeywordsAndVariablesUsagesInExecutables(final SettingTable for (final TaskTeardown taskTeardown : settingsTable.getTaskTeardowns()) { execValidators.add(ExecutableValidator.of(validationContext, additionalVariables, taskTeardown, reporter)); } - for (final TestTeardown testTeardown : settingsTable.getTestTeardownsViews()) { + for (final TestTeardown testTeardown : settingsTable.getTestTeardowns()) { execValidators.add(ExecutableValidator.of(validationContext, additionalVariables, testTeardown, reporter)); } - for (final SuiteTeardown suiteTeardown : settingsTable.getSuiteTeardownsViews()) { + for (final SuiteTeardown suiteTeardown : settingsTable.getSuiteTeardowns()) { execValidators.add(ExecutableValidator.of(validationContext, additionalVariables, suiteTeardown, reporter)); } execValidators.forEach(ExecutableValidator::validate); diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/LocalSettingsDuplicationInOldRfValidator.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/LocalSettingsDuplicationInOldRfValidator.java deleted file mode 100644 index 721b3a067..000000000 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/LocalSettingsDuplicationInOldRfValidator.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.robotframework.ide.eclipse.main.plugin.project.build.validation.versiondependent; - -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.FilePosition; -import org.rf.ide.core.testdata.text.read.RobotLine; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; -import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; -import org.robotframework.ide.eclipse.main.plugin.project.build.RobotProblem; -import org.robotframework.ide.eclipse.main.plugin.project.build.ValidationReportingStrategy; -import org.robotframework.ide.eclipse.main.plugin.project.build.causes.GeneralSettingsProblem; - -import com.google.common.collect.Range; - -class LocalSettingsDuplicationInOldRfValidator extends VersionDependentModelUnitValidator { - - private final IFile file; - - private final List fileContent; - - private final FilePosition startPosition; - - private final FilePosition endPosition; - - private final RobotTokenType duplicatedTokenType; - - private final ValidationReportingStrategy reporter; - - LocalSettingsDuplicationInOldRfValidator(final IFile file, final List fileContent, - final FilePosition startPosition, final FilePosition endPosition, final RobotTokenType duplicatedTokenType, - final ValidationReportingStrategy reporter) { - this.file = file; - this.fileContent = fileContent; - this.startPosition = startPosition; - this.endPosition = endPosition; - this.duplicatedTokenType = duplicatedTokenType; - this.reporter = reporter; - } - - @Override - protected Range getApplicableVersionRange() { - return Range.lessThan(new RobotVersion(3, 0)); - } - - @Override - public void validate(final IProgressMonitor monitor) throws CoreException { - for (int i = startPosition.getLine(); i <= endPosition.getLine(); i++) { - final RobotLine line = fileContent.get(i - 1); - for (final RobotToken token : line.getLineTokens()) { - if (token.getTypes().contains(duplicatedTokenType)) { - reporter.handleProblem(RobotProblem.causedBy(GeneralSettingsProblem.DUPLICATED_SETTING_OLD) - .formatMessageWith(token.getText()), file, token); - } - } - } - } -} diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/MetadataKeyInColumnOfSettingValidatorUntilRF30.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/MetadataKeyInColumnOfSettingValidatorUntilRF30.java deleted file mode 100644 index 1705c22fa..000000000 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/MetadataKeyInColumnOfSettingValidatorUntilRF30.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.robotframework.ide.eclipse.main.plugin.project.build.validation.versiondependent; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.Metadata; -import org.robotframework.ide.eclipse.main.plugin.project.build.RobotProblem; -import org.robotframework.ide.eclipse.main.plugin.project.build.ValidationReportingStrategy; -import org.robotframework.ide.eclipse.main.plugin.project.build.causes.GeneralSettingsProblem; - -import com.google.common.collect.Range; - -class MetadataKeyInColumnOfSettingValidatorUntilRF30 extends VersionDependentModelUnitValidator { - - private final IFile file; - - private final SettingTable table; - - private final ValidationReportingStrategy reporter; - - MetadataKeyInColumnOfSettingValidatorUntilRF30(final IFile file, final SettingTable table, - final ValidationReportingStrategy reporter) { - this.file = file; - this.table = table; - this.reporter = reporter; - } - - @Override - protected Range getApplicableVersionRange() { - return Range.closedOpen(new RobotVersion(2, 9), new RobotVersion(3, 0)); - } - - @Override - public void validate(final IProgressMonitor monitor) throws CoreException { - table.getMetadatas().stream().filter(this::hasOldSyntax).forEach(this::reportOldSyntax); - } - - private boolean hasOldSyntax(final Metadata metadata) { - return "meta:".equalsIgnoreCase(metadata.getDeclaration().getText().trim()); - } - - private void reportOldSyntax(final Metadata metadata) { - reporter.handleProblem( - RobotProblem.causedBy(GeneralSettingsProblem.METADATA_SETTING_JOINED_WITH_KEY_IN_COLUMN_29), file, - metadata.getDeclaration()); - } -} diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/SettingsDuplicationInOldRfValidator.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/SettingsDuplicationInOldRfValidator.java deleted file mode 100644 index 130b3ee53..000000000 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/SettingsDuplicationInOldRfValidator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.robotframework.ide.eclipse.main.plugin.project.build.validation.versiondependent; - -import java.util.List; -import java.util.function.Supplier; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.AModelElement; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; -import org.robotframework.ide.eclipse.main.plugin.project.build.RobotProblem; -import org.robotframework.ide.eclipse.main.plugin.project.build.ValidationReportingStrategy; -import org.robotframework.ide.eclipse.main.plugin.project.build.causes.GeneralSettingsProblem; - -import com.google.common.collect.Range; - -class SettingsDuplicationInOldRfValidator> - extends VersionDependentModelUnitValidator { - - private final IFile file; - - private final Supplier> elementsSupplier; - - private final ValidationReportingStrategy reporter; - - SettingsDuplicationInOldRfValidator(final IFile file, final Supplier> elementsSupplier, - final ValidationReportingStrategy reporter) { - this.file = file; - this.elementsSupplier = elementsSupplier; - this.reporter = reporter; - } - - @Override - protected Range getApplicableVersionRange() { - return Range.lessThan(new RobotVersion(3, 0)); - } - - @Override - public void validate(final IProgressMonitor monitor) throws CoreException { - final List elems = elementsSupplier.get(); - - if (elems.size() > 1) { - for (int i = 1; i < elems.size(); i++) { - final RobotToken token = elems.get(i).getDeclaration(); - reporter.handleProblem(RobotProblem.causedBy(GeneralSettingsProblem.DUPLICATED_SETTING_OLD) - .formatMessageWith(token.getText()), file, token); - } - } - } -} diff --git a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidators.java b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidators.java index 373542c3d..444ddbd80 100644 --- a/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidators.java +++ b/src/Eclipse-IDE/org.robotframework.ide.eclipse.main.plugin/src/org/robotframework/ide/eclipse/main/plugin/project/build/validation/versiondependent/VersionDependentValidators.java @@ -67,46 +67,37 @@ public Stream getGeneralSettingsTableValidat final Stream allValidators = Stream.of( new DeprecatedGeneralSettingsTableHeaderValidator(file, table, reporter), - new SettingsDuplicationInOldRfValidator<>(file, table::getTestTemplates, reporter), new SettingsDuplicationValidator<>(file, table::getTestTemplates, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, table::getTaskTemplates, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getSuiteSetups, reporter), new SettingsDuplicationValidator<>(file, table::getSuiteSetups, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getSuiteTeardowns, reporter), new SettingsDuplicationValidator<>(file, table::getSuiteTeardowns, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getTestSetups, reporter), new SettingsDuplicationValidator<>(file, table::getTestSetups, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getTestTeardowns, reporter), new SettingsDuplicationValidator<>(file, table::getTestTeardowns, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, table::getTaskSetups, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, table::getTaskTeardowns, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getTestTimeouts, reporter), new SettingsDuplicationValidator<>(file, table::getTestTimeouts, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, table::getTaskTimeouts, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getForceTags, reporter), new SettingsDuplicationValidator<>(file, table::getForceTags, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getDefaultTags, reporter), new SettingsDuplicationValidator<>(file, table::getDefaultTags, reporter, settingDuplDetail), - new SettingsDuplicationInOldRfValidator<>(file, table::getDocumentation, reporter), new SettingsDuplicationValidator<>(file, table::getDocumentation, reporter, settingDuplDetail), new DeprecatedGeneralSettingNameValidator(file, table, reporter), - new MetadataKeyInColumnOfSettingValidatorUntilRF30(file, table, reporter), - new TemplateSettingUntilRf31Validator(validationContext, table.getTestTemplatesViews(), reporter), + + new TemplateSettingUntilRf31Validator(validationContext, table.getTestTemplates(), reporter), new TemplateSettingUntilRf31Validator(validationContext, table.getTaskTemplates(), reporter), - new TemplateSettingValidator(validationContext, table.getTestTemplatesViews(), reporter), + new TemplateSettingValidator(validationContext, table.getTestTemplates(), reporter), new TemplateSettingValidator(validationContext, table.getTaskTemplates(), reporter), new SingleValuedSettingsHaveMultipleValuesProvidedValidator<>(file, table::getTestTimeouts, reporter, ". No timeout will be checked"), @@ -146,8 +137,6 @@ public Stream getTestCaseSettingsValidators( final IFile file = validationContext.getFile(); final List fileContent = testCase.getParent().getParent().getFileContent(); final Stream allValidators = Stream.of( - new LocalSettingsDuplicationInOldRfValidator(file, fileContent, testCase.getBeginPosition(), - testCase.getEndPosition(), RobotTokenType.TEST_CASE_SETTING_NAME_DUPLICATION, reporter), new SettingsDuplicationValidator<>(file, testCase::getSetups, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, testCase::getTeardowns, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, testCase::getTemplates, reporter, settingDuplDetail), @@ -213,8 +202,6 @@ public Stream getKeywordSettingsValidators(f final IFile file = validationContext.getFile(); final List fileContent = keyword.getParent().getParent().getFileContent(); final Stream allValidators = Stream.of( - new LocalSettingsDuplicationInOldRfValidator(file, fileContent, keyword.getBeginPosition(), - keyword.getEndPosition(), RobotTokenType.KEYWORD_SETTING_NAME_DUPLICATION, reporter), new SettingsDuplicationValidator<>(file, keyword::getArguments, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, keyword::getTeardowns, reporter, settingDuplDetail), new SettingsDuplicationValidator<>(file, keyword::getReturns, reporter, settingDuplDetail), diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/environment/RobotVersion.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/environment/RobotVersion.java index 3bbee3f26..545ee0766 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/environment/RobotVersion.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/environment/RobotVersion.java @@ -87,7 +87,7 @@ public boolean isNewerOrEqualTo(final RobotVersion otherVersion) { } public boolean isDeprecated() { - return isOlderThan(RobotVersion.from("2.9")); + return isOlderThan(RobotVersion.from("3.0")); } private boolean isLessPatch(final Optional patch1, final Optional patch2) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/KeywordCallType.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/KeywordCallType.java index e31c616b5..d29c5dd41 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/KeywordCallType.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/KeywordCallType.java @@ -7,12 +7,7 @@ import static com.google.common.collect.Sets.newHashSet; -import java.util.ArrayDeque; -import java.util.Deque; import java.util.Set; -import java.util.regex.Pattern; - -import org.rf.ide.core.execution.debug.contexts.ExecutableCallContext; public enum KeywordCallType { @@ -50,88 +45,4 @@ public static KeywordCallType from(final String keywordType) { throw new IllegalStateException("Unrecognized keyword type: " + keywordType); } } - - static class KeywordsTypesFixer { - - RunningKeyword keywordStarting(final RunningKeyword keyword, - @SuppressWarnings("unused") final StackFrameContext context) { - return keyword; - } - - RunningKeyword keywordStarted(final RunningKeyword keyword) { - return keyword; - } - - void keywordEnded() { - // nothing to do - } - } - - /** - * RobotFramework in versions older than 3.0 was wrongly reporting types - * of keywords. This fixer is able to fix those types to proper ones as used - * by RF 3.0 or later. - * For more informations regarding the issue see the discussion - * at https://github.com/robotframework/robotframework/issues/2248 - * - * @author anglart - */ - static class KeywordsTypesForRf29Fixer extends KeywordsTypesFixer { - - private static final Pattern FOR_LOOP_NAME = Pattern - .compile("^\\$\\{.+\\} (in|in range|in zip|in enumerate) \\[.+\\]"); - - private final Deque fixedKeywords = new ArrayDeque<>(); - - @Override - RunningKeyword keywordStarting(final RunningKeyword keyword, final StackFrameContext context) { - final RunningKeyword fixedKeyword = fix(keyword, context); - fixedKeywords.push(fixedKeyword); - return fixedKeyword; - } - - @Override - RunningKeyword keywordStarted(final RunningKeyword keyword) { - return fixedKeywords.peek(); - } - - @Override - void keywordEnded() { - fixedKeywords.pop(); - } - - private RunningKeyword fix(final RunningKeyword keyword, final StackFrameContext context) { - if (fixedKeywords.isEmpty()) { - return keyword; - } - - switch (fixedKeywords.peek().getType()) { - case FOR: - // only iterations are possible under FOR-type keyword - return new RunningKeyword(keyword, KeywordCallType.FOR_ITERATION); - case FOR_ITERATION: - // only normal calls are possible under FOR_ITERATION-type keyword - return new RunningKeyword(keyword, KeywordCallType.NORMAL_CALL); - default: - return new RunningKeyword(keyword, getFixedKeywordType(keyword, context)); - } - } - - private KeywordCallType getFixedKeywordType(final RunningKeyword keyword, final StackFrameContext context) { - // usually there cannot be nested SETUPS or TEARDOWNS, but with a little exception that - // keyword teardown can happen - if (keyword.isTeardown() && context instanceof ExecutableCallContext) { - final ExecutableCallContext executableCallContext = (ExecutableCallContext) context; - if (executableCallContext.isOnLastExecutable()) { - return KeywordCallType.TEARDOWN; - } - } - - return looksLikeForLoop(keyword) ? KeywordCallType.FOR : KeywordCallType.NORMAL_CALL; - } - - private boolean looksLikeForLoop(final RunningKeyword keyword) { - return FOR_LOOP_NAME.matcher(keyword.getName().toLowerCase()).matches(); - } - } } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/StacktraceBuilder.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/StacktraceBuilder.java index f906ab432..64f1801e6 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/StacktraceBuilder.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/debug/StacktraceBuilder.java @@ -13,7 +13,6 @@ import java.util.Set; import java.util.function.Supplier; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.execution.agent.RobotDefaultAgentEventListener; import org.rf.ide.core.execution.agent.event.KeywordEndedEvent; import org.rf.ide.core.execution.agent.event.KeywordStartedEvent; @@ -23,9 +22,6 @@ import org.rf.ide.core.execution.agent.event.TestEndedEvent; import org.rf.ide.core.execution.agent.event.TestStartedEvent; import org.rf.ide.core.execution.agent.event.VariablesEvent; -import org.rf.ide.core.execution.agent.event.VersionsEvent; -import org.rf.ide.core.execution.debug.KeywordCallType.KeywordsTypesFixer; -import org.rf.ide.core.execution.debug.KeywordCallType.KeywordsTypesForRf29Fixer; import org.rf.ide.core.execution.debug.StackFrame.FrameCategory; import org.rf.ide.core.execution.debug.contexts.CaseContext; import org.rf.ide.core.execution.debug.contexts.ForLoopContext; @@ -34,8 +30,6 @@ import org.rf.ide.core.execution.debug.contexts.SuiteContext; import org.rf.ide.core.testdata.model.table.keywords.names.QualifiedKeywordName; -import com.google.common.annotations.VisibleForTesting; - public class StacktraceBuilder extends RobotDefaultAgentEventListener { private final Stacktrace stacktrace; @@ -44,8 +38,6 @@ public class StacktraceBuilder extends RobotDefaultAgentEventListener { private final RobotBreakpointSupplier breakpointSupplier; - private KeywordsTypesFixer keywordsTypesFixer; - private final Set currentlyImportedResources = new LinkedHashSet<>(); public StacktraceBuilder(final Stacktrace stacktrace, final ElementsLocator locator, @@ -55,19 +47,6 @@ public StacktraceBuilder(final Stacktrace stacktrace, final ElementsLocator loca this.breakpointSupplier = breakpointSupplier; } - @VisibleForTesting - KeywordsTypesFixer getKeywordsTypesFixer() { - return keywordsTypesFixer; - } - - @Override - public void handleVersions(final VersionsEvent event) { - final RobotVersion version = RobotVersion.from(event.getRobotVersion()); - this.keywordsTypesFixer = version.isOlderThan(new RobotVersion(3, 0)) - ? new KeywordsTypesForRf29Fixer() - : new KeywordsTypesFixer(); - } - @Override public void handleSuiteStarted(final SuiteStartedEvent event) { final URI currentPath = stacktrace.getPath(false).orElse(null); @@ -94,8 +73,7 @@ public void handleTestStarted(final TestStartedEvent event) { @Override public void handleKeywordAboutToStart(final KeywordStartedEvent event) { - final StackFrameContext context = stacktrace.peekCurrentFrame().map(StackFrame::getContext).orElse(null); - final RunningKeyword keyword = keywordsTypesFixer.keywordStarting(event.getRunningKeyword(), context); + final RunningKeyword keyword = event.getRunningKeyword(); stacktrace.peekCurrentFrame().ifPresent(frame -> frame.moveToKeyword(keyword, breakpointSupplier)); } @@ -104,7 +82,7 @@ public void handleKeywordAboutToStart(final KeywordStartedEvent event) { public void handleKeywordStarted(final KeywordStartedEvent event) { final String keywordName = event.getName(); final String libraryName = event.getLibraryName(); - final RunningKeyword keyword = keywordsTypesFixer.keywordStarted(event.getRunningKeyword()); + final RunningKeyword keyword = event.getRunningKeyword(); final URI currentSuitePath = stacktrace.getPath(keyword.isSetup() || keyword.isTeardown()).orElse(null); @@ -160,8 +138,6 @@ public void handleKeywordAboutToEnd(final KeywordEndedEvent event) { @Override public void handleKeywordEnded(final KeywordEndedEvent event) { stacktrace.peekCurrentFrame().ifPresent(frame -> frame.moveOutOfKeyword()); - - keywordsTypesFixer.keywordEnded(); } @Override diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugChecker.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugChecker.java index 783b46a8b..bc48937a0 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugChecker.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugChecker.java @@ -14,8 +14,8 @@ public class AgentServerVersionsDebugChecker extends AgentServerVersionsChecker @Override protected Optional checkRobot(final String robotVersion) { final RobotVersion actualVersion = RobotVersion.from(robotVersion); - if (actualVersion.isOlderThan(new RobotVersion(2, 9))) { - return Optional.of("RED debugger requires Robot Framework in version 2.9 or newer.\n\tRobot Framework: " + if (actualVersion.isOlderThan(new RobotVersion(3, 0))) { + return Optional.of("RED debugger requires Robot Framework in version 3.0 or newer.\n\tRobot Framework: " + actualVersion.asString()); } return Optional.empty(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/LocalSettingDeclarationMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/LocalSettingDeclarationMapper.java index 0f25b5bbc..a65640fd5 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/LocalSettingDeclarationMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/LocalSettingDeclarationMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; import org.rf.ide.core.testdata.model.RobotFileOutput; @@ -39,10 +38,6 @@ public LocalSettingDeclarationMapper(final RobotTokenType declarationType, this.possibleParentNameTokenType = possibleParentNameTokenType; } - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } @Override public final boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordSettingDeclarationMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordSettingDeclarationMapperOld.java deleted file mode 100644 index 02e9a4c7e..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordSettingDeclarationMapperOld.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2018 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.keywords; - -import java.util.function.Predicate; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.ModelType; -import org.rf.ide.core.testdata.model.table.keywords.UserKeyword; -import org.rf.ide.core.testdata.text.read.ParsingState; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; -import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; - -public class KeywordSettingDeclarationMapperOld extends KeywordSettingDeclarationMapper { - - private final Predicate shouldBeCreated; - - public KeywordSettingDeclarationMapperOld(final RobotTokenType declarationType, - final ParsingState newParsingState, final ModelType settingModelType, - final Predicate shouldBeCreated) { - super(declarationType, newParsingState, settingModelType); - this.shouldBeCreated = shouldBeCreated; - } - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected void addElement(final RobotToken rt, final UserKeyword keyword) { - if (shouldBeCreated.test(keyword)) { - super.addElement(rt, keyword); - } else { - rt.getTypes().add(1, RobotTokenType.TEST_CASE_SETTING_NAME_DUPLICATION); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsMapperOld.java deleted file mode 100644 index b10171dfc..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsMapperOld.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.keywords; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.ModelType; -import org.rf.ide.core.testdata.text.read.ParsingState; -import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; - -public class KeywordTagsMapperOld extends KeywordSettingDeclarationMapperOld { - - public KeywordTagsMapperOld() { - super(RobotTokenType.KEYWORD_SETTING_TAGS, ParsingState.KEYWORD_SETTING_TAGS, - ModelType.USER_KEYWORD_TAGS, keyword -> keyword.getTags().isEmpty()); - } - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(2, 9)) - && robotVersion.isOlderThan(new RobotVersion(3, 0)); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsTagNameMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsTagNameMapper.java index e329b7903..a6db705bc 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsTagNameMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/keywords/KeywordTagsTagNameMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; import org.rf.ide.core.testdata.model.FilePosition; @@ -24,11 +23,6 @@ public class KeywordTagsTagNameMapper implements IParsingMapper { private final ParsingStateHelper utility = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(2, 9)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/SettingDeclarationMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/SettingDeclarationMapper.java index 30946fe61..4680fdb13 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/SettingDeclarationMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/SettingDeclarationMapper.java @@ -5,11 +5,9 @@ */ package org.rf.ide.core.testdata.mapping.setting; -import java.util.EnumSet; import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementPositionResolver; import org.rf.ide.core.testdata.mapping.table.ElementPositionResolver.PositionExpected; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; @@ -31,23 +29,12 @@ public abstract class SettingDeclarationMapper implements IParsingMapper { private final ElementPositionResolver positionResolver; - private final EnumSet additionalTypes = EnumSet.noneOf(RobotTokenType.class); - public SettingDeclarationMapper(final RobotTokenType declarationType, final ParsingState newParsingState) { this.declarationType = declarationType; this.newParsingState = newParsingState; this.positionResolver = new ElementPositionResolver(); } - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - additionalTypes.clear(); - if (robotVersion.isOlderThan(new RobotVersion(3, 0))) { - additionalTypes.add(RobotTokenType.SETTING_NAME_DUPLICATION); - } - return IParsingMapper.super.isApplicableFor(robotVersion); - } - @Override public final boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { @@ -71,10 +58,7 @@ public final RobotToken map(final RobotLine currentLine, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordArgumentMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordArgumentMapperOld.java deleted file mode 100644 index cd864fd2f..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordArgumentMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.suite; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.SuiteSetup; - -public class SuiteSetupKeywordArgumentMapperOld extends SuiteSetupKeywordArgumentMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List suiteSetups) { - return utility.checkIfFirstHasKeywordNameAlready(suiteSetups); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapper.java index 84f0f9a4a..e36f50ba0 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -28,11 +27,6 @@ public class SuiteSetupKeywordMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapperOld.java deleted file mode 100644 index c74616da0..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteSetupKeywordMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.suite; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.SuiteSetup; - -public class SuiteSetupKeywordMapperOld extends SuiteSetupKeywordMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List suiteSetups) { - return !utility.checkIfFirstHasKeywordNameAlready(suiteSetups); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapper.java index 9ad8fafb0..a449a4d7f 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -28,11 +27,6 @@ public class SuiteTeardownKeywordArgumentMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapperOld.java deleted file mode 100644 index e88f52989..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordArgumentMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.suite; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.SuiteTeardown; - -public class SuiteTeardownKeywordArgumentMapperOld extends SuiteTeardownKeywordArgumentMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List suiteTeardowns) { - return utility.checkIfFirstHasKeywordNameAlready(suiteTeardowns); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapper.java index 6dcbc5bac..37cedca0b 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -27,11 +26,6 @@ public class SuiteTeardownKeywordMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapperOld.java deleted file mode 100644 index 7028a88f2..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/suite/SuiteTeardownKeywordMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.suite; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.SuiteTeardown; - -public class SuiteTeardownKeywordMapperOld extends SuiteTeardownKeywordMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List suiteTeardowns) { - return !utility.checkIfFirstHasKeywordNameAlready(suiteTeardowns); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapper.java index 6bf0b609a..537259909 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -27,11 +26,6 @@ public class TestSetupKeywordArgumentMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapperOld.java deleted file mode 100644 index 098589ac0..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordArgumentMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.test; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.TestSetup; - -public class TestSetupKeywordArgumentMapperOld extends TestSetupKeywordArgumentMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List testSetups) { - return utility.checkIfFirstHasKeywordNameAlready(testSetups); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapper.java index 378611d74..dc2994eaa 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -27,11 +26,6 @@ public class TestSetupKeywordMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapperOld.java deleted file mode 100644 index 3d3303891..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestSetupKeywordMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.test; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.TestSetup; - -public class TestSetupKeywordMapperOld extends TestSetupKeywordMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List testSetups) { - return !utility.checkIfFirstHasKeywordNameAlready(testSetups); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapper.java index 3c7494145..186b51897 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -27,11 +26,6 @@ public class TestTeardownKeywordArgumentMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapperOld.java deleted file mode 100644 index e1420032d..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordArgumentMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.test; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.TestTeardown; - -public class TestTeardownKeywordArgumentMapperOld extends TestTeardownKeywordArgumentMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List testTeardowns) { - return utility.checkIfFirstHasKeywordNameAlready(testTeardowns); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapper.java index 96a3776f0..a0adbe6cf 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapper.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Stack; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.table.ElementsUtility; import org.rf.ide.core.testdata.mapping.table.IParsingMapper; import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper; @@ -27,11 +26,6 @@ public class TestTeardownKeywordMapper implements IParsingMapper { private final ParsingStateHelper stateHelper = new ParsingStateHelper(); - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)); - } - @Override public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput, final RobotLine currentLine, final RobotToken rt, final String text, final Stack processingState) { diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapperOld.java deleted file mode 100644 index 9f1353fae..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/setting/test/TestTeardownKeywordMapperOld.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.setting.test; - -import java.util.List; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.table.setting.TestTeardown; - -public class TestTeardownKeywordMapperOld extends TestTeardownKeywordMapper { - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected boolean canBeMappedTo(final List testTeardowns) { - return !utility.checkIfFirstHasKeywordNameAlready(testTeardowns); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/SettingsMapperProvider.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/SettingsMapperProvider.java index 534b5ebd9..367bf49a1 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/SettingsMapperProvider.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/SettingsMapperProvider.java @@ -30,14 +30,10 @@ import org.rf.ide.core.testdata.mapping.setting.imports.VariablesDeclarationMapper; import org.rf.ide.core.testdata.mapping.setting.imports.VariablesImportPathMapper; import org.rf.ide.core.testdata.mapping.setting.suite.SuiteSetupKeywordArgumentMapper; -import org.rf.ide.core.testdata.mapping.setting.suite.SuiteSetupKeywordArgumentMapperOld; import org.rf.ide.core.testdata.mapping.setting.suite.SuiteSetupKeywordMapper; -import org.rf.ide.core.testdata.mapping.setting.suite.SuiteSetupKeywordMapperOld; import org.rf.ide.core.testdata.mapping.setting.suite.SuiteSetupMapper; import org.rf.ide.core.testdata.mapping.setting.suite.SuiteTeardownKeywordArgumentMapper; -import org.rf.ide.core.testdata.mapping.setting.suite.SuiteTeardownKeywordArgumentMapperOld; import org.rf.ide.core.testdata.mapping.setting.suite.SuiteTeardownKeywordMapper; -import org.rf.ide.core.testdata.mapping.setting.suite.SuiteTeardownKeywordMapperOld; import org.rf.ide.core.testdata.mapping.setting.suite.SuiteTeardownMapper; import org.rf.ide.core.testdata.mapping.setting.task.TaskSetupKeywordArgumentMapper; import org.rf.ide.core.testdata.mapping.setting.task.TaskSetupKeywordMapper; @@ -52,14 +48,10 @@ import org.rf.ide.core.testdata.mapping.setting.task.TaskTimeoutMessageMapper; import org.rf.ide.core.testdata.mapping.setting.task.TaskTimeoutValueMapper; import org.rf.ide.core.testdata.mapping.setting.test.TestSetupKeywordArgumentMapper; -import org.rf.ide.core.testdata.mapping.setting.test.TestSetupKeywordArgumentMapperOld; import org.rf.ide.core.testdata.mapping.setting.test.TestSetupKeywordMapper; -import org.rf.ide.core.testdata.mapping.setting.test.TestSetupKeywordMapperOld; import org.rf.ide.core.testdata.mapping.setting.test.TestSetupMapper; import org.rf.ide.core.testdata.mapping.setting.test.TestTeardownKeywordArgumentMapper; -import org.rf.ide.core.testdata.mapping.setting.test.TestTeardownKeywordArgumentMapperOld; import org.rf.ide.core.testdata.mapping.setting.test.TestTeardownKeywordMapper; -import org.rf.ide.core.testdata.mapping.setting.test.TestTeardownKeywordMapperOld; import org.rf.ide.core.testdata.mapping.setting.test.TestTeardownMapper; import org.rf.ide.core.testdata.mapping.setting.test.TestTemplateKeywordMapper; import org.rf.ide.core.testdata.mapping.setting.test.TestTemplateMapper; @@ -88,21 +80,17 @@ public class SettingsMapperProvider { new MetadataMapper(), new MetadataKeyMapper(), new MetadataValueMapper(), - new SuiteSetupMapper(), new SuiteSetupKeywordMapper(), new SuiteSetupKeywordMapperOld(), - new SuiteSetupKeywordArgumentMapper(), new SuiteSetupKeywordArgumentMapperOld(), + new SuiteSetupMapper(), new SuiteSetupKeywordMapper(), new SuiteSetupKeywordArgumentMapper(), - new SuiteTeardownMapper(), new SuiteTeardownKeywordMapper(), new SuiteTeardownKeywordMapperOld(), - new SuiteTeardownKeywordArgumentMapper(), new SuiteTeardownKeywordArgumentMapperOld(), + new SuiteTeardownMapper(), new SuiteTeardownKeywordMapper(), new SuiteTeardownKeywordArgumentMapper(), new ForceTagsMapper(), new ForceTagsTagNameMapper(), new DefaultTagsMapper(), new DefaultTagsTagNameMapper(), - new TestSetupMapper(), new TestSetupKeywordMapper(), new TestSetupKeywordMapperOld(), - new TestSetupKeywordArgumentMapper(), new TestSetupKeywordArgumentMapperOld(), + new TestSetupMapper(), new TestSetupKeywordMapper(), new TestSetupKeywordArgumentMapper(), - new TestTeardownMapper(), new TestTeardownKeywordMapper(), new TestTeardownKeywordMapperOld(), - new TestTeardownKeywordArgumentMapper(), new TestTeardownKeywordArgumentMapperOld(), + new TestTeardownMapper(), new TestTeardownKeywordMapper(), new TestTeardownKeywordArgumentMapper(), new TestTemplateMapper(), new TestTemplateKeywordMapper(), new TestTemplateTrashDataMapper(), diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/TestCaseMapperProvider.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/TestCaseMapperProvider.java index 6c62d9c00..764d8752a 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/TestCaseMapperProvider.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/TestCaseMapperProvider.java @@ -8,11 +8,9 @@ import java.util.ArrayList; import java.util.List; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.testcases.TestCaseDocumentationTextMapper; import org.rf.ide.core.testdata.mapping.testcases.TestCaseNameMapper; import org.rf.ide.core.testdata.mapping.testcases.TestCaseSettingDeclarationMapper; -import org.rf.ide.core.testdata.mapping.testcases.TestCaseSettingDeclarationMapperOld; import org.rf.ide.core.testdata.mapping.testcases.TestCaseSetupKeywordArgumentMapper; import org.rf.ide.core.testdata.mapping.testcases.TestCaseSetupKeywordMapper; import org.rf.ide.core.testdata.mapping.testcases.TestCaseTagsTagNameMapper; @@ -35,57 +33,34 @@ public class TestCaseMapperProvider { MAPPERS.add(new TestCaseSettingDeclarationMapper(RobotTokenType.TEST_CASE_SETTING_SETUP, ParsingState.TEST_CASE_SETTING_SETUP, ModelType.TEST_CASE_SETUP)); - MAPPERS.add(new TestCaseSettingDeclarationMapperOld(RobotTokenType.TEST_CASE_SETTING_SETUP, - ParsingState.TEST_CASE_SETTING_SETUP, ModelType.TEST_CASE_SETUP, - testCase -> testCase.getSetups().isEmpty())); MAPPERS.add(new TestCaseSetupKeywordMapper()); MAPPERS.add(new TestCaseSetupKeywordArgumentMapper()); MAPPERS.add(new TestCaseSettingDeclarationMapper(RobotTokenType.TEST_CASE_SETTING_TAGS_DECLARATION, ParsingState.TEST_CASE_SETTING_TAGS, ModelType.TEST_CASE_TAGS)); - MAPPERS.add(new TestCaseSettingDeclarationMapperOld(RobotTokenType.TEST_CASE_SETTING_TAGS_DECLARATION, - ParsingState.TEST_CASE_SETTING_TAGS, ModelType.TEST_CASE_TAGS, test -> test.getTags().isEmpty())); MAPPERS.add(new TestCaseTagsTagNameMapper()); MAPPERS.add(new TestCaseSettingDeclarationMapper(RobotTokenType.TEST_CASE_SETTING_TEARDOWN, ParsingState.TEST_CASE_SETTING_TEARDOWN, ModelType.TEST_CASE_TEARDOWN)); - MAPPERS.add(new TestCaseSettingDeclarationMapperOld(RobotTokenType.TEST_CASE_SETTING_TEARDOWN, - ParsingState.TEST_CASE_SETTING_TEARDOWN, ModelType.TEST_CASE_TEARDOWN, - testCase -> testCase.getTeardowns().isEmpty())); MAPPERS.add(new TestCaseTeardownKeywordMapper()); MAPPERS.add(new TestCaseTeardownKeywordArgumentMapper()); MAPPERS.add(new TestCaseSettingDeclarationMapper(RobotTokenType.TEST_CASE_SETTING_TEMPLATE, ParsingState.TEST_CASE_SETTING_TEST_TEMPLATE, ModelType.TEST_CASE_TEMPLATE)); - MAPPERS.add(new TestCaseSettingDeclarationMapperOld(RobotTokenType.TEST_CASE_SETTING_TEMPLATE, - ParsingState.TEST_CASE_SETTING_TEST_TEMPLATE, ModelType.TEST_CASE_TEMPLATE, - testCase -> testCase.getTemplates().isEmpty())); MAPPERS.add(new TestCaseTemplateKeywordMapper()); MAPPERS.add(new TestCaseTemplateKeywordTrashArgumentMapper()); MAPPERS.add(new TestCaseSettingDeclarationMapper(RobotTokenType.TEST_CASE_SETTING_TIMEOUT, ParsingState.TEST_CASE_SETTING_TEST_TIMEOUT, ModelType.TEST_CASE_TIMEOUT)); - MAPPERS.add(new TestCaseSettingDeclarationMapperOld(RobotTokenType.TEST_CASE_SETTING_TIMEOUT, - ParsingState.TEST_CASE_SETTING_TEST_TIMEOUT, ModelType.TEST_CASE_TIMEOUT, - testCase -> testCase.getTimeouts().isEmpty())); MAPPERS.add(new TestCaseTimeoutValueMapper()); MAPPERS.add(new TestCaseTimeoutMessageMapper()); MAPPERS.add(new TestCaseSettingDeclarationMapper(RobotTokenType.TEST_CASE_SETTING_DOCUMENTATION, ParsingState.TEST_CASE_SETTING_DOCUMENTATION_DECLARATION, ModelType.TEST_CASE_DOCUMENTATION)); - MAPPERS.add(new TestCaseSettingDeclarationMapperOld(RobotTokenType.TEST_CASE_SETTING_DOCUMENTATION, - ParsingState.TEST_CASE_SETTING_DOCUMENTATION_DECLARATION, - ModelType.TEST_CASE_DOCUMENTATION, testCase -> testCase.getDocumentation().isEmpty())); MAPPERS.add(new TestCaseDocumentationTextMapper()); } - public List getMappers(final RobotVersion robotVersion) { - final List mappers = new ArrayList<>(); - for (final IParsingMapper mapper : MAPPERS) { - if (mapper.isApplicableFor(robotVersion)) { - mappers.add(mapper); - } - } - return mappers; + public List getMappers() { + return MAPPERS; } } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/UserKeywordMapperProvider.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/UserKeywordMapperProvider.java index 5de5712ae..898e54deb 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/UserKeywordMapperProvider.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/table/UserKeywordMapperProvider.java @@ -8,14 +8,11 @@ import java.util.ArrayList; import java.util.List; -import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.mapping.keywords.KeywordArgumentsValueMapper; import org.rf.ide.core.testdata.mapping.keywords.KeywordDocumentationTextMapper; import org.rf.ide.core.testdata.mapping.keywords.KeywordNameMapper; import org.rf.ide.core.testdata.mapping.keywords.KeywordReturnValueMapper; import org.rf.ide.core.testdata.mapping.keywords.KeywordSettingDeclarationMapper; -import org.rf.ide.core.testdata.mapping.keywords.KeywordSettingDeclarationMapperOld; -import org.rf.ide.core.testdata.mapping.keywords.KeywordTagsMapperOld; import org.rf.ide.core.testdata.mapping.keywords.KeywordTagsTagNameMapper; import org.rf.ide.core.testdata.mapping.keywords.KeywordTeardownArgumentMapper; import org.rf.ide.core.testdata.mapping.keywords.KeywordTeardownNameMapper; @@ -35,54 +32,32 @@ public class UserKeywordMapperProvider { MAPPERS.add(new KeywordSettingDeclarationMapper(RobotTokenType.KEYWORD_SETTING_DOCUMENTATION, ParsingState.KEYWORD_SETTING_DOCUMENTATION_DECLARATION, ModelType.USER_KEYWORD_DOCUMENTATION)); - MAPPERS.add(new KeywordSettingDeclarationMapperOld(RobotTokenType.KEYWORD_SETTING_DOCUMENTATION, - ParsingState.KEYWORD_SETTING_DOCUMENTATION_DECLARATION, ModelType.USER_KEYWORD_DOCUMENTATION, - keyword -> keyword.getDocumentation().isEmpty())); MAPPERS.add(new KeywordDocumentationTextMapper()); MAPPERS.add(new KeywordSettingDeclarationMapper(RobotTokenType.KEYWORD_SETTING_TAGS, ParsingState.KEYWORD_SETTING_TAGS, ModelType.USER_KEYWORD_TAGS)); - MAPPERS.add(new KeywordTagsMapperOld()); MAPPERS.add(new KeywordTagsTagNameMapper()); MAPPERS.add(new KeywordSettingDeclarationMapper(RobotTokenType.KEYWORD_SETTING_ARGUMENTS, ParsingState.KEYWORD_SETTING_ARGUMENTS, ModelType.USER_KEYWORD_ARGUMENTS)); - MAPPERS.add(new KeywordSettingDeclarationMapperOld(RobotTokenType.KEYWORD_SETTING_ARGUMENTS, - ParsingState.KEYWORD_SETTING_ARGUMENTS, ModelType.USER_KEYWORD_ARGUMENTS, - keyword -> keyword.getArguments().isEmpty())); MAPPERS.add(new KeywordArgumentsValueMapper()); MAPPERS.add(new KeywordSettingDeclarationMapper(RobotTokenType.KEYWORD_SETTING_RETURN, ParsingState.KEYWORD_SETTING_RETURN, ModelType.USER_KEYWORD_RETURN)); - MAPPERS.add(new KeywordSettingDeclarationMapperOld(RobotTokenType.KEYWORD_SETTING_RETURN, - ParsingState.KEYWORD_SETTING_RETURN, ModelType.USER_KEYWORD_RETURN, - keyword -> keyword.getReturns().isEmpty())); MAPPERS.add(new KeywordReturnValueMapper()); MAPPERS.add(new KeywordSettingDeclarationMapper(RobotTokenType.KEYWORD_SETTING_TEARDOWN, ParsingState.KEYWORD_SETTING_TEARDOWN, ModelType.USER_KEYWORD_TEARDOWN)); - MAPPERS.add(new KeywordSettingDeclarationMapperOld(RobotTokenType.KEYWORD_SETTING_TEARDOWN, - ParsingState.KEYWORD_SETTING_TEARDOWN, ModelType.USER_KEYWORD_TEARDOWN, - keyword -> keyword.getTeardowns().isEmpty())); MAPPERS.add(new KeywordTeardownNameMapper()); MAPPERS.add(new KeywordTeardownArgumentMapper()); MAPPERS.add(new KeywordSettingDeclarationMapper(RobotTokenType.KEYWORD_SETTING_TIMEOUT, ParsingState.KEYWORD_SETTING_TIMEOUT, ModelType.USER_KEYWORD_TIMEOUT)); - MAPPERS.add(new KeywordSettingDeclarationMapperOld(RobotTokenType.KEYWORD_SETTING_TIMEOUT, - ParsingState.KEYWORD_SETTING_TIMEOUT, ModelType.USER_KEYWORD_TIMEOUT, - keyword -> keyword.getTimeouts().isEmpty())); MAPPERS.add(new KeywordTimeoutValueMapper()); MAPPERS.add(new KeywordTimeoutMessageMapper()); } - public List getMappers(final RobotVersion robotVersion) { - final List mappers = new ArrayList<>(); - for (final IParsingMapper mapper : MAPPERS) { - if (mapper.isApplicableFor(robotVersion)) { - mappers.add(mapper); - } - } - return mappers; + public List getMappers() { + return MAPPERS; } } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/testcases/TestCaseSettingDeclarationMapperOld.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/testcases/TestCaseSettingDeclarationMapperOld.java deleted file mode 100644 index 7c0477091..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/testcases/TestCaseSettingDeclarationMapperOld.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2018 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.mapping.testcases; - -import java.util.function.Predicate; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.ModelType; -import org.rf.ide.core.testdata.model.table.testcases.TestCase; -import org.rf.ide.core.testdata.text.read.ParsingState; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; -import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; - -public class TestCaseSettingDeclarationMapperOld extends TestCaseSettingDeclarationMapper { - - private final Predicate shouldBeCreated; - - public TestCaseSettingDeclarationMapperOld(final RobotTokenType declarationType, final ParsingState newParsingState, - final ModelType settingModelType, final Predicate shouldBeCreated) { - super(declarationType, newParsingState, settingModelType); - this.shouldBeCreated = shouldBeCreated; - } - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - protected void addElement(final RobotToken rt, final TestCase testCase) { - if (shouldBeCreated.test(testCase)) { - super.addElement(rt, testCase); - } else { - rt.getTypes().add(1, RobotTokenType.TEST_CASE_SETTING_NAME_DUPLICATION); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/MultipleSettingsViewsCreator.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/MultipleSettingsViewsCreator.java index 3fce734bf..e93f993b0 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/MultipleSettingsViewsCreator.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/MultipleSettingsViewsCreator.java @@ -5,15 +5,10 @@ */ package org.rf.ide.core.testdata.model.table; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.function.Function; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.AModelElement; - public class MultipleSettingsViewsCreator { public static Optional createView(final List settings, final Function, T> viewCreator) { @@ -25,17 +20,4 @@ public static Optional createView(final List settings, final Function< return Optional.of(viewCreator.apply(settings)); } } - - public static > List createView(final RobotVersion version, final P parent, - final List settings, final Function, T> viewCreator) { - if (version.isOlderThan(new RobotVersion(3, 0))) { - final List tmpSettings = new ArrayList<>(); - final Optional view = createView(settings, viewCreator); - view.ifPresent(v -> v.setParent(parent)); - view.ifPresent(tmpSettings::add); - return Collections.unmodifiableList(tmpSettings); - } else { - return Collections.unmodifiableList(settings); - } - } } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/SettingTable.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/SettingTable.java index 339f4a47e..642fcfe1a 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/SettingTable.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/SettingTable.java @@ -16,8 +16,8 @@ import org.rf.ide.core.environment.RobotVersion; import org.rf.ide.core.testdata.model.AModelElement; -import org.rf.ide.core.testdata.model.TemplateSetting; import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.TemplateSetting; import org.rf.ide.core.testdata.model.presenter.MoveElementHelper; import org.rf.ide.core.testdata.model.table.setting.AImported; import org.rf.ide.core.testdata.model.table.setting.DefaultTags; @@ -38,15 +38,7 @@ import org.rf.ide.core.testdata.model.table.setting.TestTimeout; import org.rf.ide.core.testdata.model.table.setting.UnknownSetting; import org.rf.ide.core.testdata.model.table.setting.VariablesImport; -import org.rf.ide.core.testdata.model.table.setting.views.DefaultTagsView; -import org.rf.ide.core.testdata.model.table.setting.views.ForceTagsView; import org.rf.ide.core.testdata.model.table.setting.views.SuiteDocumentationView; -import org.rf.ide.core.testdata.model.table.setting.views.SuiteSetupView; -import org.rf.ide.core.testdata.model.table.setting.views.SuiteTeardownView; -import org.rf.ide.core.testdata.model.table.setting.views.TestSetupView; -import org.rf.ide.core.testdata.model.table.setting.views.TestTeardownView; -import org.rf.ide.core.testdata.model.table.setting.views.TestTemplateView; -import org.rf.ide.core.testdata.model.table.setting.views.TestTimeoutView; import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; @@ -260,11 +252,6 @@ public void removeMetadata(final Metadata metadata) { metadatas.remove(metadata); } - public List getSuiteSetupsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, suiteSetups, SuiteSetupView::new); - } - public List getSuiteSetups() { return Collections.unmodifiableList(suiteSetups); } @@ -289,11 +276,6 @@ public void removeSuiteSetup() { suiteSetups.clear(); } - public List getSuiteTeardownsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, suiteTeardowns, SuiteTeardownView::new); - } - public List getSuiteTeardowns() { return Collections.unmodifiableList(suiteTeardowns); } @@ -329,11 +311,6 @@ public ForceTags newForceTag() { return tags; } - public List getForceTagsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, forceTags, ForceTagsView::new); - } - public List getForceTags() { return Collections.unmodifiableList(forceTags); } @@ -347,11 +324,6 @@ public void removeForceTags() { forceTags.clear(); } - public List getDefaultTagsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, defaultTags, DefaultTagsView::new); - } - public List getDefaultTags() { return Collections.unmodifiableList(defaultTags); } @@ -376,11 +348,6 @@ public void removeDefaultTags() { defaultTags.clear(); } - public List getTestSetupsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, testSetups, TestSetupView::new); - } - public List getTestSetups() { return Collections.unmodifiableList(testSetups); } @@ -428,11 +395,6 @@ public void removeTaskSetup() { taskSetups.clear(); } - public List getTestTeardownsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, testTeardowns, TestTeardownView::new); - } - public List getTestTeardowns() { return Collections.unmodifiableList(testTeardowns); } @@ -480,11 +442,6 @@ public void removeTaskTeardown() { taskTeardowns.clear(); } - public List getTestTemplatesViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, testTemplates, TestTemplateView::new); - } - public List getTestTemplates() { return Collections.unmodifiableList(testTemplates); } @@ -572,11 +529,6 @@ public void removeTaskTemplate() { taskTemplates.clear(); } - public List getTestTimeoutsViews() { - final RobotVersion version = getVersion(); - return MultipleSettingsViewsCreator.createView(version, this, testTimeouts, TestTimeoutView::new); - } - public List getTestTimeouts() { return Collections.unmodifiableList(testTimeouts); } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsView.java deleted file mode 100644 index adce79075..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsView.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.ATags; -import org.rf.ide.core.testdata.model.table.setting.DefaultTags; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class DefaultTagsView extends DefaultTags { - - private static final long serialVersionUID = 737877218936160644L; - - private final List defaultTags; - - public DefaultTagsView(final List defaultTags) { - super(defaultTags.get(0).getDeclaration()); - this.defaultTags = defaultTags; - - initialize(); - } - - private void initialize() { - for (final ATags defaultTag : defaultTags) { - for (final RobotToken tag : defaultTag.getTags()) { - super.addTag(tag); - } - for (final RobotToken comment : defaultTag.getComment()) { - super.addCommentPart(comment); - } - } - } - - @Override - public void addTag(final String tag) { - joinIfNeeded(); - super.addTag(tag); - } - - @Override - public void addTag(final RobotToken tag) { - joinIfNeeded(); - super.addTag(tag); - } - - @Override - public void setTag(final int index, final String tag) { - final List tokens = super.getTags(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setTag(index, tag); - } - - @Override - public void setTag(final int index, final RobotToken tag) { - final List tokens = super.getTags(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setTag(index, tag); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (defaultTags.size() > 1) { - defaultTags.clear(); - defaultTags.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsView.java deleted file mode 100644 index 18de10ab6..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsView.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.ATags; -import org.rf.ide.core.testdata.model.table.setting.ForceTags; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class ForceTagsView extends ForceTags { - - private static final long serialVersionUID = 5413048519586897277L; - - private final List forceTags; - - public ForceTagsView(final List forceTags) { - super(forceTags.get(0).getDeclaration()); - this.forceTags = forceTags; - - initialize(); - } - - private void initialize() { - for (final ATags forceTag : forceTags) { - for (final RobotToken tag : forceTag.getTags()) { - super.addTag(tag); - } - for (final RobotToken comment : forceTag.getComment()) { - super.addCommentPart(comment); - } - } - } - - @Override - public void addTag(final String tag) { - joinIfNeeded(); - super.addTag(tag); - } - - @Override - public void addTag(final RobotToken tag) { - joinIfNeeded(); - super.addTag(tag); - } - - @Override - public void setTag(final int index, final String tag) { - final List tokens = super.getTags(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setTag(index, tag); - } - - @Override - public void setTag(final int index, final RobotToken tag) { - final List tokens = super.getTags(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setTag(index, tag); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (forceTags.size() > 1) { - forceTags.clear(); - forceTags.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationView.java index 8b2566b97..67cbfe247 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationView.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationView.java @@ -17,7 +17,7 @@ public class SuiteDocumentationView extends SuiteDocumentation { public SuiteDocumentationView(final List suiteDocs) { super(suiteDocs.get(0).getDeclaration()); this.suiteDocs = suiteDocs; - + initialize(); } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupView.java deleted file mode 100644 index ba7257341..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupView.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.AKeywordBaseSetting; -import org.rf.ide.core.testdata.model.table.setting.SuiteSetup; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class SuiteSetupView extends SuiteSetup { - - private static final long serialVersionUID = 500336715462459117L; - - private final List setups; - - public SuiteSetupView(final List setups) { - super(setups.get(0).getDeclaration()); - this.setups = setups; - - initialize(); - } - - private void initialize() { - for (final AKeywordBaseSetting setup : setups) { - if (setup.getKeywordName() != null) { - if (getKeywordName() != null) { - super.addArgument(setup.getKeywordName()); - } else { - super.setKeywordName(setup.getKeywordName()); - } - } - - for (final RobotToken arg : setup.getArguments()) { - super.addArgument(arg); - } - for (final RobotToken commentText : setup.getComment()) { - super.addCommentPart(commentText); - } - } - } - - @Override - public void addArgument(final String argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void addArgument(final RobotToken argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void setArgument(final int index, final String argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setArgument(final int index, final RobotToken argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (setups.size() > 1) { - setups.clear(); - setups.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownView.java deleted file mode 100644 index d3e3fb5e8..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownView.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.AKeywordBaseSetting; -import org.rf.ide.core.testdata.model.table.setting.SuiteTeardown; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class SuiteTeardownView extends SuiteTeardown { - - private static final long serialVersionUID = 8749176995341442757L; - - private final List teardowns; - - public SuiteTeardownView(final List teardowns) { - super(teardowns.get(0).getDeclaration()); - this.teardowns = teardowns; - - initialize(); - } - - private void initialize() { - for (final AKeywordBaseSetting teardown : teardowns) { - if (teardown.getKeywordName() != null) { - if (getKeywordName() != null) { - super.addArgument(teardown.getKeywordName()); - } else { - super.setKeywordName(teardown.getKeywordName()); - } - } - for (final RobotToken arg : teardown.getArguments()) { - super.addArgument(arg); - } - for (final RobotToken commentText : teardown.getComment()) { - super.addCommentPart(commentText); - } - } - } - - @Override - public void addArgument(final String argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void addArgument(final RobotToken argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void setArgument(final int index, final String argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setArgument(final int index, final RobotToken argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (teardowns.size() > 1) { - teardowns.clear(); - teardowns.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupView.java deleted file mode 100644 index cbd266e45..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupView.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.AKeywordBaseSetting; -import org.rf.ide.core.testdata.model.table.setting.TestSetup; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class TestSetupView extends TestSetup { - - private static final long serialVersionUID = 507193410421635171L; - - private final List setups; - - public TestSetupView(final List setups) { - super(setups.get(0).getDeclaration()); - this.setups = setups; - - initialize(); - } - - private void initialize() { - for (final AKeywordBaseSetting setup : setups) { - if (setup.getKeywordName() != null) { - if (getKeywordName() != null) { - super.addArgument(setup.getKeywordName()); - } else { - super.setKeywordName(setup.getKeywordName()); - } - } - for (final RobotToken arg : setup.getArguments()) { - super.addArgument(arg); - } - for (final RobotToken commentText : setup.getComment()) { - super.addCommentPart(commentText); - } - } - } - - @Override - public void addArgument(final String argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void addArgument(final RobotToken argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void setArgument(final int index, final String argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setArgument(final int index, final RobotToken argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (setups.size() > 1) { - setups.clear(); - setups.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownView.java deleted file mode 100644 index 64fd6d591..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownView.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.AKeywordBaseSetting; -import org.rf.ide.core.testdata.model.table.setting.TestTeardown; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class TestTeardownView extends TestTeardown { - - private static final long serialVersionUID = 2216473610245038551L; - - private final List teardowns; - - public TestTeardownView(final List teardowns) { - super(teardowns.get(0).getDeclaration()); - this.teardowns = teardowns; - - initialize(); - } - - private void initialize() { - for (final AKeywordBaseSetting teardown : teardowns) { - if (teardown.getKeywordName() != null) { - if (getKeywordName() != null) { - super.addArgument(teardown.getKeywordName()); - } else { - super.setKeywordName(teardown.getKeywordName()); - } - } - for (final RobotToken arg : teardown.getArguments()) { - super.addArgument(arg); - } - for (final RobotToken commentText : teardown.getComment()) { - super.addCommentPart(commentText); - } - } - } - - @Override - public void addArgument(final String argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void addArgument(final RobotToken argument) { - joinIfNeeded(); - super.addArgument(argument); - } - - @Override - public void setArgument(final int index, final String argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setArgument(final int index, final RobotToken argument) { - final List tokens = super.getArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setArgument(index, argument); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (teardowns.size() > 1) { - teardowns.clear(); - teardowns.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTemplateView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTemplateView.java deleted file mode 100644 index 9372592cd..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTemplateView.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2018 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.table.setting.TestTemplate; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class TestTemplateView extends TestTemplate { - - private static final long serialVersionUID = 6978724647058934866L; - - private final List templates; - - public TestTemplateView(final List templates) { - super(templates.get(0).getDeclaration()); - this.templates = templates; - - initialize(); - } - - private void initialize() { - for (final TestTemplate template : templates) { - if (template.getKeywordName() != null) { - if (getKeywordName() != null) { - super.addUnexpectedTrashArgument(template.getKeywordName()); - } else { - super.setKeywordName(template.getKeywordName()); - } - } - for (final RobotToken arg : template.getUnexpectedArguments()) { - super.addUnexpectedTrashArgument(arg); - } - for (final RobotToken commentText : template.getComment()) { - super.addCommentPart(commentText); - } - } - - } - - @Override - public void addUnexpectedTrashArgument(final RobotToken trashArgument) { - joinIfNeeded(); - super.addUnexpectedTrashArgument(trashArgument); - } - - @Override - public void addUnexpectedTrashArgument(final String trashArgument) { - joinIfNeeded(); - super.addUnexpectedTrashArgument(trashArgument); - } - - @Override - public void setUnexpectedTrashArgument(final int index, final String argument) { - final List tokens = super.getUnexpectedArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setUnexpectedTrashArgument(index, argument); - } - - @Override - public void setUnexpectedTrashArgument(final int index, final RobotToken argument) { - final List tokens = super.getUnexpectedArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setUnexpectedTrashArgument(index, argument); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - private synchronized void joinIfNeeded() { - if (templates.size() > 1) { - templates.clear(); - templates.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutView.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutView.java deleted file mode 100644 index 57d2b075c..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutView.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import java.util.List; - -import org.rf.ide.core.testdata.model.table.setting.TestTimeout; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class TestTimeoutView extends TestTimeout { - - private static final long serialVersionUID = -4081479282712030528L; - - private final List timeouts; - - public TestTimeoutView(final List timeouts) { - super(timeouts.get(0).getDeclaration()); - this.timeouts = timeouts; - - initialize(); - } - - private void initialize() { - for (final TestTimeout timeout : timeouts) { - if (timeout.getTimeout() != null) { - if (getTimeout() != null) { - super.addMessageArgument(timeout.getTimeout()); - } else { - super.setTimeout(timeout.getTimeout()); - } - } - for (final RobotToken msg : timeout.getMessageArguments()) { - super.addMessageArgument(msg); - } - for (final RobotToken comment : timeout.getComment()) { - super.addCommentPart(comment); - } - } - } - - @Override - public void addMessageArgument(final String messageArgument) { - joinIfNeeded(); - super.addMessageArgument(messageArgument); - } - - @Override - public void addMessageArgument(final RobotToken messageArgument) { - joinIfNeeded(); - super.addMessageArgument(messageArgument); - } - - @Override - public void setMessageArgument(final int index, final String argument) { - final List tokens = super.getMessageArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setMessageArgument(index, argument); - } - - @Override - public void setMessageArgument(final int index, final RobotToken argument) { - final List tokens = super.getMessageArguments(); - if (tokens.size() <= index) { - joinIfNeeded(); - } - super.setMessageArgument(index, argument); - } - - @Override - public void addCommentPart(final RobotToken rt) { - joinIfNeeded(); - super.addCommentPart(rt); - } - - @Override - public void setComment(final String comment) { - joinIfNeeded(); - super.setComment(comment); - } - - @Override - public void setComment(final RobotToken rt) { - joinIfNeeded(); - super.setComment(rt); - } - - private synchronized void joinIfNeeded() { - if (timeouts.size() > 1) { - timeouts.clear(); - timeouts.add(this); - } - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/TextualRobotFileParser.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/TextualRobotFileParser.java index 5b9ee6094..4da7bcfcf 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/TextualRobotFileParser.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/TextualRobotFileParser.java @@ -158,9 +158,9 @@ private void initializeRecognizersAndMappers(final RobotVersion robotVersion) { mappers.clear(); mappers.addAll(new SettingsMapperProvider().getMappers(robotVersion)); mappers.addAll(new VariablesDeclarationMapperProvider().getMappers()); - mappers.addAll(new TestCaseMapperProvider().getMappers(robotVersion)); + mappers.addAll(new TestCaseMapperProvider().getMappers()); mappers.addAll(new TaskMapperProvider().getMappers(robotVersion)); - mappers.addAll(new UserKeywordMapperProvider().getMappers(robotVersion)); + mappers.addAll(new UserKeywordMapperProvider().getMappers()); mappers.addAll(new CommentsMapperProvider().getMappers(robotVersion)); unknownTableElementsMapper.clear(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/RobotTokenType.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/RobotTokenType.java index ba68f3f2d..618e23505 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/RobotTokenType.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/RobotTokenType.java @@ -167,11 +167,7 @@ public enum RobotTokenType implements IRobotTokenType { TableType.SETTINGS, true, VersionAvailabilityInfoBuilder.create().addRepresentation("Metadata").build(), - VersionAvailabilityInfoBuilder.create().addRepresentation("Metadata:").build(), - VersionAvailabilityInfoBuilder.create().deprecatedFrom("2.9").removedFrom("3.0") - .addRepresentation("Meta").build(), - VersionAvailabilityInfoBuilder.create().deprecatedFrom("2.9").removedFrom("3.0") - .addRepresentation("Meta:").build()), + VersionAvailabilityInfoBuilder.create().addRepresentation("Metadata:").build()), /** */ SETTING_METADATA_KEY(TableType.SETTINGS), diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/SettingsRecognizersProvider.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/SettingsRecognizersProvider.java index 30efecd1f..4d327193d 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/SettingsRecognizersProvider.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/SettingsRecognizersProvider.java @@ -13,7 +13,6 @@ import org.rf.ide.core.testdata.text.read.recognizer.settings.DefaultTagsRecognizer; import org.rf.ide.core.testdata.text.read.recognizer.settings.ForceTagsRecognizer; import org.rf.ide.core.testdata.text.read.recognizer.settings.LibraryDeclarationRecognizer; -import org.rf.ide.core.testdata.text.read.recognizer.settings.MetaRecognizer; import org.rf.ide.core.testdata.text.read.recognizer.settings.MetadataRecognizer; import org.rf.ide.core.testdata.text.read.recognizer.settings.ResourceDeclarationRecognizer; import org.rf.ide.core.testdata.text.read.recognizer.settings.SettingDocumentRecognizer; @@ -45,7 +44,7 @@ public class SettingsRecognizersProvider { new ResourceDeclarationRecognizer(), new SettingDocumentationRecognizer(), new SettingDocumentRecognizer(), - new MetadataRecognizer(), new MetaRecognizer(), + new MetadataRecognizer(), new SuiteSetupRecognizer(), new SuiteTeardownRecognizer(), new SuitePreconditionRecognizer(), new SuitePostconditionRecognizer(), new ForceTagsRecognizer(), new DefaultTagsRecognizer(), diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordPostconditionRecognizer.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordPostconditionRecognizer.java index cf10a54ab..cf282c989 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordPostconditionRecognizer.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordPostconditionRecognizer.java @@ -23,8 +23,8 @@ public KeywordPostconditionRecognizer() { @Override public boolean isApplicableFor(final RobotVersion robotVersion) { - // [Postcondition] is not recognized in e.g. 2.9, but it is working in 3.0, however warning - // is shown that it is deprecated and finally this setting is removed from 3.1 + // [Postcondition] is working in 3.0, however warning is shown that + // it is deprecated and finally this setting is removed from 3.1 return robotVersion.isNewerOrEqualTo(new RobotVersion(3, 0)) && robotVersion.isOlderThan(new RobotVersion(3, 1)); } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordTagsRecognizer.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordTagsRecognizer.java index 5d8f38d50..1d74a0b6a 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordTagsRecognizer.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/keywords/KeywordTagsRecognizer.java @@ -19,7 +19,7 @@ public KeywordTagsRecognizer() { @Override public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion != null && robotVersion.isNewerOrEqualTo(new RobotVersion(2, 9)); + return robotVersion != null; } @Override diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizer.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizer.java deleted file mode 100644 index 0e2c420df..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizer.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2015 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.text.read.recognizer.settings; - -import java.util.regex.Pattern; - -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.text.read.recognizer.ATokenRecognizer; -import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; - -public class MetaRecognizer extends ATokenRecognizer { - - public static final Pattern EXPECTED = Pattern.compile("[ ]?(" + createUpperLowerCaseWord("Meta") + ":)"); - - public MetaRecognizer() { - super(EXPECTED, RobotTokenType.SETTING_METADATA_DECLARATION); - } - - @Override - public boolean isApplicableFor(final RobotVersion robotVersion) { - return robotVersion != null && robotVersion.isOlderThan(new RobotVersion(3, 0)); - } - - @Override - public ATokenRecognizer newInstance() { - return new MetaRecognizer(); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_libraries.py b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_libraries.py index 9207722ac..8d32bebee 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_libraries.py +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_libraries.py @@ -6,13 +6,8 @@ def get_standard_library_names(): - try: - import robot.running.namespace - return list(robot.running.namespace.STDLIB_NAMES) - except: - # the std libraries set was moved to other place since Robot 2.9.1 - import robot.libraries - return list(robot.libraries.STDLIBS) + import robot.libraries + return list(robot.libraries.STDLIBS) def get_standard_library_path(libname): diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_variables.py b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_variables.py index 2265a7068..ec92c35db 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_variables.py +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts/red_variables.py @@ -47,22 +47,17 @@ def get_global_variables(): } glob_variables = {} - try: - from robot.variables import GLOBAL_VARIABLES - - glob_variables = GLOBAL_VARIABLES - except ImportError: # for robot >2.9 - global_variables['&{EMPTY}'] = {} - global_variables['&{SUITE_METADATA}'] = {} - from robot.conf.settings import RobotSettings - from robot.variables.scopes import GlobalVariables - - glob_variables = GlobalVariables(RobotSettings()).as_dict() - glob_variables['${OUTPUT_DIR}'] = '' - glob_variables['${EXECDIR}'] = '' - glob_variables['${OUTPUT_FILE}'] = '' - glob_variables['${REPORT_FILE}'] = '' - glob_variables['${LOG_FILE}'] = '' + global_variables['&{EMPTY}'] = {} + global_variables['&{SUITE_METADATA}'] = {} + from robot.conf.settings import RobotSettings + from robot.variables.scopes import GlobalVariables + + glob_variables = GlobalVariables(RobotSettings()).as_dict() + glob_variables['${OUTPUT_DIR}'] = '' + glob_variables['${EXECDIR}'] = '' + glob_variables['${OUTPUT_FILE}'] = '' + glob_variables['${REPORT_FILE}'] = '' + glob_variables['${LOG_FILE}'] = '' data = dict((_wrap_variable_if_needed(key), value) for key, value in glob_variables.items()) diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/environment/RobotVersionTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/environment/RobotVersionTest.java index 7caf990b4..123d6a4bd 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/environment/RobotVersionTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/environment/RobotVersionTest.java @@ -205,8 +205,8 @@ public void isDeprecatedTest_whenVersionHasNoPatch() { assertThat(RobotVersion.from("1.2").isDeprecated()).isTrue(); assertThat(RobotVersion.from("2.7").isDeprecated()).isTrue(); assertThat(RobotVersion.from("2.8").isDeprecated()).isTrue(); + assertThat(RobotVersion.from("2.9").isDeprecated()).isTrue(); - assertThat(RobotVersion.from("2.9").isDeprecated()).isFalse(); assertThat(RobotVersion.from("3.0").isDeprecated()).isFalse(); assertThat(RobotVersion.from("5.9").isDeprecated()).isFalse(); @@ -217,8 +217,8 @@ public void isDeprecatedTest_whenVersionHasPatch() { assertThat(RobotVersion.from("1.2.3").isDeprecated()).isTrue(); assertThat(RobotVersion.from("2.7.2").isDeprecated()).isTrue(); assertThat(RobotVersion.from("2.8.9").isDeprecated()).isTrue(); + assertThat(RobotVersion.from("2.9.0").isDeprecated()).isTrue(); - assertThat(RobotVersion.from("2.9.0").isDeprecated()).isFalse(); assertThat(RobotVersion.from("3.0.2").isDeprecated()).isFalse(); assertThat(RobotVersion.from("5.9.3").isDeprecated()).isFalse(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/KeywordCallTypeTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/KeywordCallTypeTest.java index 10276a0e4..dcec5051c 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/KeywordCallTypeTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/KeywordCallTypeTest.java @@ -7,13 +7,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; import org.junit.jupiter.api.Test; -import org.rf.ide.core.execution.debug.KeywordCallType.KeywordsTypesFixer; -import org.rf.ide.core.execution.debug.KeywordCallType.KeywordsTypesForRf29Fixer; -import org.rf.ide.core.execution.debug.contexts.ExecutableCallContext; public class KeywordCallTypeTest { @@ -23,347 +18,11 @@ public void exceptionIsThrown_whenTypeIsNotRecognized() { } @Test - public void allRf3TypesAreCorrectlyTranslated() { + public void allTypesAreCorrectlyTranslated() { assertThat(KeywordCallType.from("keyword")).isEqualTo(KeywordCallType.NORMAL_CALL); assertThat(KeywordCallType.from("setup")).isEqualTo(KeywordCallType.SETUP); assertThat(KeywordCallType.from("teardown")).isEqualTo(KeywordCallType.TEARDOWN); assertThat(KeywordCallType.from("for")).isEqualTo(KeywordCallType.FOR); assertThat(KeywordCallType.from("for item")).isEqualTo(KeywordCallType.FOR_ITERATION); } - - @Test - public void allPreRf3TypesAreCorrectlyTranslated() { - assertThat(KeywordCallType.from("keyword")).isEqualTo(KeywordCallType.NORMAL_CALL); - assertThat(KeywordCallType.from("suite setup")).isEqualTo(KeywordCallType.SETUP); - assertThat(KeywordCallType.from("test setup")).isEqualTo(KeywordCallType.SETUP); - assertThat(KeywordCallType.from("suite teardown")).isEqualTo(KeywordCallType.TEARDOWN); - assertThat(KeywordCallType.from("test teardown")).isEqualTo(KeywordCallType.TEARDOWN); - assertThat(KeywordCallType.from("test for")).isEqualTo(KeywordCallType.FOR); - assertThat(KeywordCallType.from("test foritem")).isEqualTo(KeywordCallType.FOR_ITERATION); - } - - @Test - public void defaultFixerJustReturnsGivenKeyword() { - final KeywordsTypesFixer fixer = new KeywordsTypesFixer(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), null)) - .isEqualTo(keyword("kw", KeywordCallType.SETUP)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.SETUP)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), null)) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), null)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${x} IN RANGE [0 | 1]", KeywordCallType.FOR), null)) - .isEqualTo(keyword("${x} IN RANGE [0 | 1]", KeywordCallType.FOR)); - assertThat(fixer.keywordStarted(keyword("${x} IN RANGE [0 | 1]", KeywordCallType.FOR))) - .isEqualTo(keyword("${x} IN RANGE [0 | 1]", KeywordCallType.FOR)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), null)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - } - @Test - public void preRf3FixerReturnsProperTypes_whenTopLevelKeywordIsCalled() { - final StackFrameContext context = null; - - final KeywordsTypesForRf29Fixer fixer = new KeywordsTypesForRf29Fixer(); - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context)) - .isEqualTo(keyword("kw", KeywordCallType.SETUP)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.SETUP)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context)) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR), context)) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - assertThat(fixer.keywordStarted(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR))) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - fixer.keywordEnded(); - } - - @Test - public void preRf3FixerReturnsProperTypes_whenForLoopWasPreviouslyCalled() { - final StackFrameContext context = null; - - final KeywordsTypesForRf29Fixer fixer = new KeywordsTypesForRf29Fixer(); - fixer.keywordStarting(keyword("${x} IN [0]", KeywordCallType.FOR), context); - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context)) - .isEqualTo(keyword("kw", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context)) - .isEqualTo(keyword("kw", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context)) - .isEqualTo(keyword("kw", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR), context)) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR_ITERATION)); - assertThat(fixer.keywordStarted(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR))) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR_ITERATION)); - fixer.keywordEnded(); - - fixer.keywordEnded(); - } - - @Test - public void preRf3FixerReturnsProperTypes_whenForLoopIterationWasPreviouslyCalled() { - final StackFrameContext context = null; - - final KeywordsTypesForRf29Fixer fixer = new KeywordsTypesForRf29Fixer(); - fixer.keywordStarting(keyword("${x} IN [0]", KeywordCallType.FOR), context); - fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context); - - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR), context)) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR))) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - fixer.keywordEnded(); - } - - @Test - public void preRf3FixerReturnsProperTypes_whenSetupWasPreviouslyCalled() { - final StackFrameContext context = null; - final ExecutableCallContext executableContext1 = mock(ExecutableCallContext.class); - when(executableContext1.isOnLastExecutable()).thenReturn(false); - final ExecutableCallContext executableContext2 = mock(ExecutableCallContext.class); - when(executableContext2.isOnLastExecutable()).thenReturn(true); - - final KeywordsTypesForRf29Fixer fixer = new KeywordsTypesForRf29Fixer(); - fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context); - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR), context)) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - assertThat(fixer.keywordStarted(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR))) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), executableContext1)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), executableContext2)) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - fixer.keywordEnded(); - - fixer.keywordEnded(); - } - - @Test - public void preRf3FixerReturnsProperTypes_whenTeardownWasPreviouslyCalled() { - final StackFrameContext context = null; - final ExecutableCallContext executableContext1 = mock(ExecutableCallContext.class); - when(executableContext1.isOnLastExecutable()).thenReturn(false); - final ExecutableCallContext executableContext2 = mock(ExecutableCallContext.class); - when(executableContext2.isOnLastExecutable()).thenReturn(true); - - final KeywordsTypesForRf29Fixer fixer = new KeywordsTypesForRf29Fixer(); - fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context); - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR), context)) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - assertThat(fixer.keywordStarted(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR))) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), executableContext1)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), executableContext2)) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - fixer.keywordEnded(); - - fixer.keywordEnded(); - } - - @Test - public void preRf3FixerReturnsProperTypes_whenNormalTypeWasPreviouslyCalled() { - final StackFrameContext context = null; - final ExecutableCallContext executableContext1 = mock(ExecutableCallContext.class); - when(executableContext1.isOnLastExecutable()).thenReturn(false); - final ExecutableCallContext executableContext2 = mock(ExecutableCallContext.class); - when(executableContext2.isOnLastExecutable()).thenReturn(true); - - final KeywordsTypesForRf29Fixer fixer = new KeywordsTypesForRf29Fixer(); - fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context); - - assertThat(fixer.keywordStarting(keyword("${x} = 0", KeywordCallType.FOR_ITERATION), context)) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("${x} = 0", KeywordCallType.FOR_ITERATION))) - .isEqualTo(keyword("${x} = 0", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.NORMAL_CALL), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.NORMAL_CALL))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.SETUP), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.SETUP))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), context)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR), context)) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - assertThat(fixer.keywordStarted(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR))) - .isEqualTo(keyword("${y} IN RANGE [0 | 2]", KeywordCallType.FOR)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), executableContext1)) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.NORMAL_CALL)); - fixer.keywordEnded(); - - assertThat(fixer.keywordStarting(keyword("kw", KeywordCallType.TEARDOWN), executableContext2)) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - assertThat(fixer.keywordStarted(keyword("kw", KeywordCallType.TEARDOWN))) - .isEqualTo(keyword("kw", KeywordCallType.TEARDOWN)); - fixer.keywordEnded(); - - fixer.keywordEnded(); - } - - private static RunningKeyword keyword(final String name, final KeywordCallType type) { - return new RunningKeyword("", name, type); - } } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/StacktraceBuilderTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/StacktraceBuilderTest.java index 9499bb46a..76b95dd8b 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/StacktraceBuilderTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/debug/StacktraceBuilderTest.java @@ -34,8 +34,6 @@ import org.rf.ide.core.execution.agent.event.VariableTypedValue; import org.rf.ide.core.execution.agent.event.VariablesEvent; import org.rf.ide.core.execution.agent.event.VersionsEvent; -import org.rf.ide.core.execution.debug.KeywordCallType.KeywordsTypesFixer; -import org.rf.ide.core.execution.debug.KeywordCallType.KeywordsTypesForRf29Fixer; import org.rf.ide.core.execution.debug.StackFrame.FrameCategory; import org.rf.ide.core.execution.debug.contexts.CaseContext; import org.rf.ide.core.execution.debug.contexts.KeywordContext; @@ -43,27 +41,6 @@ public class StacktraceBuilderTest { - @Test - public void properKeywordTypesFixerIsCreated_dependingOnRobotVersion() { - final ElementsLocator locator = mock(ElementsLocator.class); - final StacktraceBuilder builder = new StacktraceBuilder(new Stacktrace(), locator, new RobotBreakpointSupplier()); - - builder.handleVersions(new VersionsEvent(null, "", "", "2.5", 1, Optional.of(42L))); - assertThat(builder.getKeywordsTypesFixer()).isExactlyInstanceOf(KeywordsTypesForRf29Fixer.class); - - builder.handleVersions(new VersionsEvent(null, "", "", "2.7", 1, Optional.of(42L))); - assertThat(builder.getKeywordsTypesFixer()).isExactlyInstanceOf(KeywordsTypesForRf29Fixer.class); - - builder.handleVersions(new VersionsEvent(null, "", "", "2.9", 1, Optional.of(42L))); - assertThat(builder.getKeywordsTypesFixer()).isExactlyInstanceOf(KeywordsTypesForRf29Fixer.class); - - builder.handleVersions(new VersionsEvent(null, "", "", "3.0", 1, Optional.of(42L))); - assertThat(builder.getKeywordsTypesFixer()).isExactlyInstanceOf(KeywordsTypesFixer.class); - - builder.handleVersions(new VersionsEvent(null, "", "", "3.2", 1, Optional.of(42L))); - assertThat(builder.getKeywordsTypesFixer()).isExactlyInstanceOf(KeywordsTypesFixer.class); - } - @Test public void frameForSuiteIsCreatedWithCurrentlyImportedResources_whenSuiteStarts() { final SuiteContext context = mock(SuiteContext.class); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugCheckerTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugCheckerTest.java index 0818bcc05..97323ab51 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugCheckerTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/execution/server/AgentServerVersionsDebugCheckerTest.java @@ -34,7 +34,7 @@ public void correctVersionMsgIsSendToClient_whenVersionsAreMatching() throws Exc final AgentServerVersionsDebugChecker checker = new AgentServerVersionsDebugChecker(); final List attributes = newArrayList( - ImmutableMap.of("cmd_line", "cmd", "python", "", "robot", "2.9", "protocol", + ImmutableMap.of("cmd_line", "cmd", "python", "", "robot", "3.0", "protocol", getCurrentProtocolVersion())); final Map eventMap = ImmutableMap.of("version", attributes); checker.handleVersions(VersionsEvent.from(client, eventMap)); @@ -97,7 +97,7 @@ public void incorrectVersionMsgIsSendToClientAndExceptionIsThrown_whenRobotVersi assertThatExceptionOfType(RobotAgentEventsListenerException.class) .isThrownBy(() -> checker.handleVersions(VersionsEvent.from(client, eventMap))) - .withMessage("RED debugger requires Robot Framework in version 2.9 or newer.\n\tRobot Framework: 2.8") + .withMessage("RED debugger requires Robot Framework in version 3.0 or newer.\n\tRobot Framework: 2.8") .withNoCause(); verify(client).send(any(ProtocolVersion.class)); } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserSimpleExecutableContinueTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserSimpleExecutableContinueTest.java index 4b9b7afdc..75ecf049e 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserSimpleExecutableContinueTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserSimpleExecutableContinueTest.java @@ -32,6 +32,8 @@ */ public class RobotParserSimpleExecutableContinueTest { + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + @Test public void givenTwoKeywords_oneWithNormalName_andSecondWithTripleDotsName_shouldReturnTwoKeywords() throws Exception { @@ -42,7 +44,7 @@ public void givenTwoKeywords_oneWithNormalName_andSecondWithTripleDotsName_shoul when(projectHolder.shouldBeParsed(file)).thenReturn(true); // execute - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final List parsed = parser.parse(file); // verify @@ -72,7 +74,7 @@ public void test_givenMultipleRobotExecutableLines_withCommentsJoinedByPreviousL when(projectHolder.shouldBeParsed(file)).thenReturn(true); // execute - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final List parsed = parser.parse(file); // verify diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserTest.java index fc08621e4..e0291377e 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/RobotParserTest.java @@ -40,6 +40,7 @@ public class RobotParserTest { + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); @TempDir static File tempDir; @@ -47,7 +48,7 @@ public class RobotParserTest { public void errorMessageIsReported_whenFileHasNotSupportedExtension() throws Exception { final String fileContent = "some content"; final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final RobotFileOutput editorContent = parser.parseEditorContent(fileContent, new File("f.unknown")); @@ -66,7 +67,7 @@ public void errorMessageIsReported_whenFileHasNotSupportedExtension() throws Exc public void emptyOutputIsReturned_whenContentIsNull() throws Exception { final String fileContent = null; final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final RobotFileOutput editorContent = parser.parseEditorContent(fileContent, new File("f.robot")); @@ -77,7 +78,7 @@ public void emptyOutputIsReturned_whenContentIsNull() throws Exception { public void emptyOutputIsReturned_whenContentIsEmpty() throws Exception { final String fileContent = ""; final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final RobotFileOutput editorContent = parser.parseEditorContent(fileContent, new File("f.robot")); @@ -88,7 +89,7 @@ public void emptyOutputIsReturned_whenContentIsEmpty() throws Exception { public void notEmptyOutputIsReturned_whenContentIsNotEmptyAndFileHasSupportedExtension() throws Exception { final String fileContent = "***Settings***"; final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); for (final String name : newHashSet("f.robot", "f.txt", "f.tsv")) { final RobotFileOutput editorContent = parser.parseEditorContent(fileContent, new File(name)); @@ -105,7 +106,7 @@ public void test_eolInLinux_lineChecksWithoutNewLineAtTheEnd_offsetCheck() { final RobotProjectHolder projectHolder = new RobotProjectHolder(); // execute - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final RobotFileOutput editorContent = parser.parseEditorContent(fileContent, new File("f.robot")); // verify @@ -125,7 +126,7 @@ public void test_eolInLinux_lineChecks_offsetCheck() { final RobotProjectHolder projectHolder = new RobotProjectHolder(); // execute - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final RobotFileOutput editorContent = parser.parseEditorContent(fileContent, new File("f.robot")); // verify @@ -171,7 +172,7 @@ private void assertOneCorrectAndOneWrongVariable_ifAllWasReadAndWillBePresented( // prepare final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); //// prepare paths final File startFile = new File(this.getClass().getResource(filename).toURI()); @@ -220,7 +221,7 @@ public void test_givenTwoTestCasesInTsvFile_oneIsEmpty_andSecondIsJustVariableNa // prepare final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); // prepare paths final File startFile = new File(this.getClass().getResource("parser/bugs/tsv_positionCheck.tsv").toURI()); @@ -266,7 +267,7 @@ public void test_givenTwoTestCasesInTsvFile_oneIsEmpty_andSecondIsJustVariableNa public void emptyOutputIsReturned_whenFileIsNull() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final File startFile = null; @@ -279,7 +280,7 @@ public void emptyOutputIsReturned_whenFileIsNull() throws Exception { public void emptyOutputIsReturned_whenFileHasNotSupportedExtension() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final File startFile = new File(tempDir, "file.unknown"); startFile.createNewFile(); @@ -293,7 +294,7 @@ public void emptyOutputIsReturned_whenFileHasNotSupportedExtension() throws Exce public void notEmptyOutputIsReturned_whenFileHasSupportedExtension() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); for (final String name : newHashSet("f.robot", "f.txt", "f.tsv")) { final File startFile = new File(tempDir, name); @@ -310,7 +311,7 @@ public void notEmptyOutputIsReturned_whenFileHasSupportedExtension() throws Exce public void fileShouldBeParsedOnlyOnce() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final File startFile = new File(tempDir, "file.robot"); final String fileContent = "***Settings***"; @@ -331,7 +332,7 @@ public void fileShouldBeParsedOnlyOnce() throws Exception { public void fileShouldBeCleared_whenContainsTooManyLines() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final File startFile = new File(tempDir, "file_with_5000_lines.robot"); final String fileContent = String.join("", Collections.nCopies(5000, "abc" + System.lineSeparator())); @@ -347,7 +348,7 @@ public void fileShouldBeCleared_whenContainsTooManyLines() throws Exception { public void fileShouldNotBeCleared_whenDoesNotContainTooManyLines() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final File startFile = new File(tempDir, "file_with_4999_lines.robot"); final String fileContent = String.join("", Collections.nCopies(4999, "abc" + System.lineSeparator())); @@ -363,7 +364,7 @@ public void fileShouldNotBeCleared_whenDoesNotContainTooManyLines() throws Excep public void directoryShouldBeParsed() throws Exception { final RobotProjectHolder projectHolder = new RobotProjectHolder(); - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, ROBOT_VERSION); final File startDir = new File(tempDir, "dir_with_suites"); startDir.mkdir(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/TrashCommentsParsingTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/TrashCommentsParsingTest.java index ca71eadec..1108d5ec4 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/TrashCommentsParsingTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/TrashCommentsParsingTest.java @@ -40,7 +40,7 @@ public void test_givenMultipleRobotExecutableLines_withCommentsJoinedByPreviousL when(projectHolder.shouldBeParsed(file)).thenReturn(true); // execute - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(3, 0)); final List parsed = parser.parse(file); // verify diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/DocumentationCacherInsideRobotFileOutputTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/DocumentationCacherInsideRobotFileOutputTest.java index 1f1ed879e..67bba16d1 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/DocumentationCacherInsideRobotFileOutputTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/DocumentationCacherInsideRobotFileOutputTest.java @@ -45,8 +45,8 @@ public class DocumentationCacherInsideRobotFileOutputTest { @BeforeAll public static void setup() throws Exception { final Path path = getFile("presenter//DocPositionsFind.robot"); - final RobotParser parser = new RobotParser(new RobotProjectHolder(new RobotRuntimeEnvironment(null, "2.9.0")), - new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(new RobotProjectHolder(new RobotRuntimeEnvironment(null, "3.0.0")), + new RobotVersion(3, 0)); final RobotFile modelFile = RobotModelTestProvider.getModelFile(path, parser); out = modelFile.getParent(); assertThat(out).isNotNull(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/KeywordTableModelUpdaterTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/KeywordTableModelUpdaterTest.java index 8cdcc2358..35902710b 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/KeywordTableModelUpdaterTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/KeywordTableModelUpdaterTest.java @@ -46,7 +46,7 @@ public class KeywordTableModelUpdaterTest { @BeforeAll public static void setupModel() { - final RobotFile model = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile model = NewRobotFileTestHelper.getModelFileToModify("3.0"); model.includeKeywordTableSection(); keywordTable = model.getKeywordTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/SettingTableModelUpdaterTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/SettingTableModelUpdaterTest.java index 288c7242a..9805d59a7 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/SettingTableModelUpdaterTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/presenter/update/SettingTableModelUpdaterTest.java @@ -45,7 +45,7 @@ public class SettingTableModelUpdaterTest { @BeforeAll public static void setup() { - final RobotFile model = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile model = NewRobotFileTestHelper.getModelFileToModify("3.0"); model.includeSettingTableSection(); settingTable = model.getSettingTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/SettingTableTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/SettingTableTest.java index a99c6cf66..1716b8037 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/SettingTableTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/SettingTableTest.java @@ -13,29 +13,6 @@ public class SettingTableTest { - @Test - public void testTemplateInUse_forRfUnder30() { - final SettingTable settingsTable1 = ModelBuilder.modelForFile(new RobotVersion(2, 9)) - .withSettingsTable() - .withTestTemplate("keyword") - .build() - .getSettingTable(); - final SettingTable settingsTable2 = ModelBuilder.modelForFile(new RobotVersion(2, 9)) - .withSettingsTable() - .withTestTemplate("keyword", "2") - .build() - .getSettingTable(); - final SettingTable settingsTable3 = ModelBuilder.modelForFile(new RobotVersion(2, 9)) - .withSettingsTable() - .withTestTemplate("keyword", "2") - .withTestTemplate("keyword", "4") - .build().getSettingTable(); - - assertThat(settingsTable1.getTestTemplateInUse()).isEqualTo("keyword"); - assertThat(settingsTable2.getTestTemplateInUse()).isEqualTo("keyword 2"); - assertThat(settingsTable3.getTestTemplateInUse()).isEqualTo("keyword 2 keyword 4"); - } - @Test public void testTemplateInUse_forRf30And31() { final SettingTable settingsTable1 = ModelBuilder.modelForFile(new RobotVersion(3, 1)) diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/exec/descs/SettingsTableAsExecutableRowDescriptorBuilderTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/exec/descs/SettingsTableAsExecutableRowDescriptorBuilderTest.java index 754ca97aa..8297e92ee 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/exec/descs/SettingsTableAsExecutableRowDescriptorBuilderTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/exec/descs/SettingsTableAsExecutableRowDescriptorBuilderTest.java @@ -32,21 +32,21 @@ public void test_suiteSetup_withForContinueToken_shouldReturn_simpleLine() { private void assertIsSimpleLineForSettingTable(final String actionToken) { // prepare - final RobotFileOutput rfo = new RobotFileOutput(RobotVersion.from("2.9")); + final RobotFileOutput rfo = new RobotFileOutput(RobotVersion.from("3.0")); rfo.setProcessedFile(new File("fake.txt")); final RobotFile rf = new RobotFile(rfo); rf.includeSettingTableSection(); - SuiteSetup s = rf.getSettingTable().newSuiteSetup(); + final SuiteSetup s = rf.getSettingTable().newSuiteSetup(); - RobotToken keywordAction = new RobotToken(); + final RobotToken keywordAction = new RobotToken(); keywordAction.setText(actionToken); keywordAction.setLineNumber(10); s.setKeywordName(keywordAction); s.addArgument("a"); // execute - IExecutableRowDescriptor lineDesc = s.asExecutableRow().buildLineDescription(); + final IExecutableRowDescriptor lineDesc = s.asExecutableRow().buildLineDescription(); // verify assertThat(lineDesc.getRowType()).isEqualTo(RowType.SIMPLE); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/keywords/UserKeywordRemoveElementsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/keywords/UserKeywordRemoveElementsTest.java index 94fa0ba24..45b4c6a4d 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/keywords/UserKeywordRemoveElementsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/keywords/UserKeywordRemoveElementsTest.java @@ -29,7 +29,7 @@ public class UserKeywordRemoveElementsTest { @BeforeEach public void setUp() { - final RobotFileOutput out = new RobotFileOutput(RobotVersion.from("2.9.0")); + final RobotFileOutput out = new RobotFileOutput(RobotVersion.from("3.0.0")); out.getFileModel().includeKeywordTableSection(); keyword = new UserKeyword(new RobotToken()); out.getFileModel().getKeywordTable().addKeyword(keyword); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/DefaultTagsTest.java similarity index 63% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsViewTest.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/DefaultTagsTest.java index a38343ba2..2bef6a21b 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/DefaultTagsViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/DefaultTagsTest.java @@ -1,121 +1,133 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.getText; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.DefaultTags; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class DefaultTagsViewTest { - - @Test - public void test_tags_retrival_twoDefaultTags() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final RobotToken tagDecOne = new RobotToken(); - final DefaultTags defaultOne = new DefaultTags(tagDecOne); - defaultOne.addTag("tag1"); - defaultOne.addTag("tag2"); - - final RobotToken tagDecTwo = new RobotToken(); - final DefaultTags defaultTwo = new DefaultTags(tagDecTwo); - defaultTwo.addTag("tag1a"); - defaultTwo.addTag("tag2a"); - - settingTable.addDefaultTags(defaultOne); - settingTable.addDefaultTags(defaultTwo); - - // execute - final List defaultTags = settingTable.getDefaultTagsViews(); - - // verify - assertThat(defaultTags).hasSize(1); - final DefaultTags joined = defaultTags.get(0); - assertThat(joined.getTags()).hasSize(4); - assertThat(getText(joined.getTags())).containsExactly("tag1", "tag2", "tag1a", "tag2a"); - assertThat(settingTable.getDefaultTags()).hasSize(2); - } - - @Test - public void test_tags_retrival_afterTagRemove_singleDefaultTags() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final RobotToken tagDecOne = new RobotToken(); - final DefaultTags defaultOne = new DefaultTags(tagDecOne); - defaultOne.addTag("tag1"); - defaultOne.addTag("tag2"); - - final RobotToken tagDecTwo = new RobotToken(); - final DefaultTags defaultTwo = new DefaultTags(tagDecTwo); - defaultTwo.addTag("tag1a"); - defaultTwo.addTag("tag2a"); - - settingTable.addDefaultTags(defaultOne); - settingTable.addDefaultTags(defaultTwo); - - // execute - final List defaultTags = settingTable.getDefaultTagsViews(); - defaultTags.get(0).addTag("tag3"); - - // verify - assertThat(defaultTags).hasSize(1); - final DefaultTags joined = defaultTags.get(0); - assertThat(joined.getTags()).hasSize(5); - assertThat(getText(joined.getTags())).containsExactly("tag1", "tag2", "tag1a", "tag2a", "tag3"); - assertThat(settingTable.getDefaultTags()).hasSize(1); - assertThat(settingTable.getDefaultTags().get(0)).isSameAs(joined); - } - - @Test - public void test_tags_retrival_afterModification_twoDefaultTags() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final RobotToken tagDecOne = new RobotToken(); - final DefaultTags defaultOne = new DefaultTags(tagDecOne); - defaultOne.addTag("tag1"); - defaultOne.addTag("tag2"); - - final RobotToken tagDecTwo = new RobotToken(); - final DefaultTags defaultTwo = new DefaultTags(tagDecTwo); - defaultTwo.addTag("tag1a"); - defaultTwo.addTag("tag2a"); - - settingTable.addDefaultTags(defaultOne); - settingTable.addDefaultTags(defaultTwo); - - // execute - final List defaultTags = settingTable.getDefaultTagsViews(); - defaultTwo.getTags().get(0).setText("mod"); - - // verify - assertThat(defaultTags).hasSize(1); - final DefaultTags joined = defaultTags.get(0); - assertThat(joined.getTags()).hasSize(4); - assertThat(getText(joined.getTags())).containsExactly("tag1", "tag2", "mod", "tag2a"); - assertThat(settingTable.getDefaultTags()).hasSize(2); - } -} +/* + * Copyright 2016 Nokia Solutions and Networks + * Licensed under the Apache License, Version 2.0, + * see license.txt file for details. + */ +package org.rf.ide.core.testdata.model.table.setting; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.getText; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; +import org.rf.ide.core.testdata.model.table.setting.DefaultTags; +import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; + +public class DefaultTagsTest { + + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + + @Test + public void test_tags_retrival_twoDefaultTags() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final RobotToken tagDecOne = new RobotToken(); + final DefaultTags defaultOne = new DefaultTags(tagDecOne); + defaultOne.addTag("tag1"); + defaultOne.addTag("tag2"); + + final RobotToken tagDecTwo = new RobotToken(); + final DefaultTags defaultTwo = new DefaultTags(tagDecTwo); + defaultTwo.addTag("tag1a"); + defaultTwo.addTag("tag2a"); + + settingTable.addDefaultTags(defaultOne); + settingTable.addDefaultTags(defaultTwo); + + // execute + final List defaultTags = settingTable.getDefaultTags(); + + // verify + assertThat(defaultTags).hasSize(2); + final DefaultTags tag1 = defaultTags.get(0); + final DefaultTags tag2 = defaultTags.get(1); + assertThat(tag1.getTags()).hasSize(2); + assertThat(tag2.getTags()).hasSize(2); + assertThat(getText(tag1.getTags())).containsExactly("tag1", "tag2"); + assertThat(getText(tag2.getTags())).containsExactly("tag1a", "tag2a"); + assertThat(settingTable.getDefaultTags()).hasSize(2); + } + + @Test + public void test_tags_retrival_afterTagAddition_twoDefaultTags() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final RobotToken tagDecOne = new RobotToken(); + final DefaultTags defaultOne = new DefaultTags(tagDecOne); + defaultOne.addTag("tag1"); + defaultOne.addTag("tag2"); + + final RobotToken tagDecTwo = new RobotToken(); + final DefaultTags defaultTwo = new DefaultTags(tagDecTwo); + defaultTwo.addTag("tag1a"); + defaultTwo.addTag("tag2a"); + + settingTable.addDefaultTags(defaultOne); + settingTable.addDefaultTags(defaultTwo); + + // execute + final List defaultTags = settingTable.getDefaultTags(); + defaultTags.get(1).addTag("tag3"); + + // verify + assertThat(defaultTags).hasSize(2); + final DefaultTags tag1 = defaultTags.get(0); + final DefaultTags tag2 = defaultTags.get(1); + assertThat(tag1.getTags()).hasSize(2); + assertThat(tag2.getTags()).hasSize(3); + assertThat(getText(tag1.getTags())).containsExactly("tag1", "tag2"); + assertThat(getText(tag2.getTags())).containsExactly("tag1a", "tag2a", "tag3"); + assertThat(settingTable.getDefaultTags()).hasSize(2); + assertThat(settingTable.getDefaultTags().get(0)).isSameAs(tag1); + assertThat(settingTable.getDefaultTags().get(1)).isSameAs(tag2); + } + + @Test + public void test_tags_retrival_afterModification_twoDefaultTags() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final RobotToken tagDecOne = new RobotToken(); + final DefaultTags defaultOne = new DefaultTags(tagDecOne); + defaultOne.addTag("tag1"); + defaultOne.addTag("tag2"); + + final RobotToken tagDecTwo = new RobotToken(); + final DefaultTags defaultTwo = new DefaultTags(tagDecTwo); + defaultTwo.addTag("tag1a"); + defaultTwo.addTag("tag2a"); + + settingTable.addDefaultTags(defaultOne); + settingTable.addDefaultTags(defaultTwo); + + // execute + final List defaultTags = settingTable.getDefaultTags(); + defaultTwo.getTags().get(0).setText("mod"); + + // verify + assertThat(defaultTags).hasSize(2); + final DefaultTags tag1 = defaultTags.get(0); + final DefaultTags tag2 = defaultTags.get(1); + assertThat(tag1.getTags()).hasSize(2); + assertThat(tag2.getTags()).hasSize(2); + assertThat(getText(tag1.getTags())).containsExactly("tag1", "tag2"); + assertThat(getText(tag2.getTags())).containsExactly("mod", "tag2a"); + assertThat(settingTable.getDefaultTags()).hasSize(2); + } +} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/ForceTagsTest.java similarity index 61% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsViewTest.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/ForceTagsTest.java index f1a711259..61a0c85aa 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/ForceTagsViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/ForceTagsTest.java @@ -1,121 +1,133 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.getText; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.ForceTags; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; - -public class ForceTagsViewTest { - - @Test - public void test_tags_retrival_twoForceTags() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final RobotToken tagDecOne = new RobotToken(); - final ForceTags defaultOne = new ForceTags(tagDecOne); - defaultOne.addTag("tag1"); - defaultOne.addTag("tag2"); - - final RobotToken tagDecTwo = new RobotToken(); - final ForceTags defaultTwo = new ForceTags(tagDecTwo); - defaultTwo.addTag("tag1a"); - defaultTwo.addTag("tag2a"); - - settingTable.addForceTags(defaultOne); - settingTable.addForceTags(defaultTwo); - - // execute - final List defaultTags = settingTable.getForceTagsViews(); - - // verify - assertThat(defaultTags).hasSize(1); - final ForceTags joined = defaultTags.get(0); - assertThat(joined.getTags()).hasSize(4); - assertThat(getText(joined.getTags())).containsExactly("tag1", "tag2", "tag1a", "tag2a"); - assertThat(settingTable.getForceTags()).hasSize(2); - } - - @Test - public void test_tags_retrival_afterTagRemove_singleForceTags() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final RobotToken tagDecOne = new RobotToken(); - final ForceTags defaultOne = new ForceTags(tagDecOne); - defaultOne.addTag("tag1"); - defaultOne.addTag("tag2"); - - final RobotToken tagDecTwo = new RobotToken(); - final ForceTags defaultTwo = new ForceTags(tagDecTwo); - defaultTwo.addTag("tag1a"); - defaultTwo.addTag("tag2a"); - - settingTable.addForceTags(defaultOne); - settingTable.addForceTags(defaultTwo); - - // execute - final List defaultTags = settingTable.getForceTagsViews(); - defaultTags.get(0).addTag("tag3"); - - // verify - assertThat(defaultTags).hasSize(1); - final ForceTags joined = defaultTags.get(0); - assertThat(joined.getTags()).hasSize(5); - assertThat(getText(joined.getTags())).containsExactly("tag1", "tag2", "tag1a", "tag2a", "tag3"); - assertThat(settingTable.getForceTags()).hasSize(1); - assertThat(settingTable.getForceTags().get(0)).isSameAs(joined); - } - - @Test - public void test_tags_retrival_afterModification_twoForceTags() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final RobotToken tagDecOne = new RobotToken(); - final ForceTags defaultOne = new ForceTags(tagDecOne); - defaultOne.addTag("tag1"); - defaultOne.addTag("tag2"); - - final RobotToken tagDecTwo = new RobotToken(); - final ForceTags defaultTwo = new ForceTags(tagDecTwo); - defaultTwo.addTag("tag1a"); - defaultTwo.addTag("tag2a"); - - settingTable.addForceTags(defaultOne); - settingTable.addForceTags(defaultTwo); - - // execute - final List defaultTags = settingTable.getForceTagsViews(); - defaultTwo.getTags().get(0).setText("mod"); - - // verify - assertThat(defaultTags).hasSize(1); - final ForceTags joined = defaultTags.get(0); - assertThat(joined.getTags()).hasSize(4); - assertThat(getText(joined.getTags())).containsExactly("tag1", "tag2", "mod", "tag2a"); - assertThat(settingTable.getForceTags()).hasSize(2); - } -} +/* + * Copyright 2016 Nokia Solutions and Networks + * Licensed under the Apache License, Version 2.0, + * see license.txt file for details. + */ +package org.rf.ide.core.testdata.model.table.setting; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.getText; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; +import org.rf.ide.core.testdata.model.table.setting.ForceTags; +import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; + +public class ForceTagsTest { + + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + + @Test + public void test_tags_retrival_twoForceTags() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final RobotToken tagDecOne = new RobotToken(); + final ForceTags defaultOne = new ForceTags(tagDecOne); + defaultOne.addTag("tag1"); + defaultOne.addTag("tag2"); + + final RobotToken tagDecTwo = new RobotToken(); + final ForceTags defaultTwo = new ForceTags(tagDecTwo); + defaultTwo.addTag("tag1a"); + defaultTwo.addTag("tag2a"); + + settingTable.addForceTags(defaultOne); + settingTable.addForceTags(defaultTwo); + + // execute + final List defaultTags = settingTable.getForceTags(); + + // verify + assertThat(defaultTags).hasSize(2); + final ForceTags tag1 = defaultTags.get(0); + final ForceTags tag2 = defaultTags.get(1); + assertThat(tag1.getTags()).hasSize(2); + assertThat(tag2.getTags()).hasSize(2); + assertThat(getText(tag1.getTags())).containsExactly("tag1", "tag2"); + assertThat(getText(tag2.getTags())).containsExactly("tag1a", "tag2a"); + assertThat(settingTable.getForceTags()).hasSize(2); + } + + @Test + public void test_tags_retrival_afterTagAddition_twoForceTags() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final RobotToken tagDecOne = new RobotToken(); + final ForceTags defaultOne = new ForceTags(tagDecOne); + defaultOne.addTag("tag1"); + defaultOne.addTag("tag2"); + + final RobotToken tagDecTwo = new RobotToken(); + final ForceTags defaultTwo = new ForceTags(tagDecTwo); + defaultTwo.addTag("tag1a"); + defaultTwo.addTag("tag2a"); + + settingTable.addForceTags(defaultOne); + settingTable.addForceTags(defaultTwo); + + // execute + final List defaultTags = settingTable.getForceTags(); + defaultTags.get(1).addTag("tag3"); + + // verify + assertThat(defaultTags).hasSize(2); + final ForceTags tag1 = defaultTags.get(0); + final ForceTags tag2 = defaultTags.get(1); + assertThat(tag1.getTags()).hasSize(2); + assertThat(tag2.getTags()).hasSize(3); + assertThat(getText(tag1.getTags())).containsExactly("tag1", "tag2"); + assertThat(getText(tag2.getTags())).containsExactly("tag1a", "tag2a", "tag3"); + assertThat(settingTable.getForceTags()).hasSize(2); + assertThat(settingTable.getForceTags().get(0)).isSameAs(tag1); + assertThat(settingTable.getForceTags().get(1)).isSameAs(tag2); + } + + @Test + public void test_tags_retrival_afterModification_twoModifiedForceTags() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final RobotToken tagDecOne = new RobotToken(); + final ForceTags defaultOne = new ForceTags(tagDecOne); + defaultOne.addTag("tag1"); + defaultOne.addTag("tag2"); + + final RobotToken tagDecTwo = new RobotToken(); + final ForceTags defaultTwo = new ForceTags(tagDecTwo); + defaultTwo.addTag("tag1a"); + defaultTwo.addTag("tag2a"); + + settingTable.addForceTags(defaultOne); + settingTable.addForceTags(defaultTwo); + + // execute + final List defaultTags = settingTable.getForceTags(); + defaultTwo.getTags().get(0).setText("mod"); + + // verify + assertThat(defaultTags).hasSize(2); + final ForceTags tag1 = defaultTags.get(0); + final ForceTags tag2 = defaultTags.get(1); + assertThat(tag1.getTags()).hasSize(2); + assertThat(tag2.getTags()).hasSize(2); + assertThat(getText(tag1.getTags())).containsExactly("tag1", "tag2"); + assertThat(getText(tag2.getTags())).containsExactly("mod", "tag2a"); + assertThat(settingTable.getForceTags()).hasSize(2); + } +} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/ModelTokenTestHelper.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/ModelTokenTestHelper.java similarity index 91% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/ModelTokenTestHelper.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/ModelTokenTestHelper.java index a76f834e8..0d1ae3cfc 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/ModelTokenTestHelper.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/ModelTokenTestHelper.java @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0, * see license.txt file for details. */ -package org.rf.ide.core.testdata.model.table.setting.views; +package org.rf.ide.core.testdata.model.table.setting; import java.util.ArrayList; import java.util.List; diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/SuiteSetupTest.java similarity index 60% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupViewTest.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/SuiteSetupTest.java index cf4f1577b..a2ec8a738 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteSetupViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/SuiteSetupTest.java @@ -1,140 +1,150 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.createToken; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.getText; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.SuiteSetup; - -public class SuiteSetupViewTest { - - @Test - public void test_twoSuiteSetupDeclarationsOnlyKeywords_andAddThenArgumentInPosition2_shouldReturn_singleSuite() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteSetup setupOne = new SuiteSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - - final SuiteSetup setupTwo = new SuiteSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - - settingTable.addSuiteSetup(setupOne); - settingTable.addSuiteSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getSuiteSetupsViews(); - assertThat(suiteSetup).hasSize(1); - final SuiteSetup common = suiteSetup.get(0); - common.setArgument(2, "arg"); - // verify - assertThat(getText(common)).containsExactly("key1", "key2", "", "arg"); - assertThat(settingTable.getSuiteSetups()).hasSize(1); - assertThat(settingTable.getSuiteSetups().get(0)).isSameAs(common); - } - - @Test - public void test_twoSuiteSetupDeclarations_shouldReturn_commonView() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteSetup setupOne = new SuiteSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - setupOne.addArgument(createToken("arg1")); - - final SuiteSetup setupTwo = new SuiteSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - setupTwo.addArgument(createToken("arg2")); - - settingTable.addSuiteSetup(setupOne); - settingTable.addSuiteSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getSuiteSetupsViews(); - - // verify - assertThat(suiteSetup).hasSize(1); - final SuiteSetup common = suiteSetup.get(0); - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2"); - assertThat(settingTable.getSuiteSetups()).hasSize(2); - } - - @Test - public void test_twoSuiteSetupDeclarations_addOneArgument_shouldReturn_singleElement() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteSetup setupOne = new SuiteSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - setupOne.addArgument(createToken("arg1")); - - final SuiteSetup setupTwo = new SuiteSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - setupTwo.addArgument(createToken("arg2")); - - settingTable.addSuiteSetup(setupOne); - settingTable.addSuiteSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getSuiteSetupsViews(); - assertThat(suiteSetup).hasSize(1); - final SuiteSetup common = suiteSetup.get(0); - common.addArgument(createToken("newArg")); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2", "newArg"); - assertThat(settingTable.getSuiteSetups()).hasSize(1); - } - - @Test - public void test_twoSuiteSetupDeclarations_modificationOfOneArgument_shouldReturn_twoElementsStill() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteSetup setupOne = new SuiteSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - setupOne.addArgument(createToken("arg1")); - - final SuiteSetup setupTwo = new SuiteSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - setupTwo.addArgument(createToken("arg2")); - - settingTable.addSuiteSetup(setupOne); - settingTable.addSuiteSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getSuiteSetupsViews(); - assertThat(suiteSetup).hasSize(1); - final SuiteSetup common = suiteSetup.get(0); - common.getArguments().get(2).setText("mod"); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "mod"); - assertThat(settingTable.getSuiteSetups()).hasSize(2); - } - -} +/* + * Copyright 2016 Nokia Solutions and Networks + * Licensed under the Apache License, Version 2.0, + * see license.txt file for details. + */ +package org.rf.ide.core.testdata.model.table.setting; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.createToken; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.getText; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; + +public class SuiteSetupTest { + + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + + @Test + public void test_twoSuiteSetupDeclarationsOnlyKeywords_andAddThenArgumentInPosition2_shouldReturn_twoSetupsWithAdditionalArgument() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteSetup setupOne = new SuiteSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + + final SuiteSetup setupTwo = new SuiteSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + + settingTable.addSuiteSetup(setupOne); + settingTable.addSuiteSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getSuiteSetups(); + assertThat(suiteSetup).hasSize(2); + final SuiteSetup setup1 = suiteSetup.get(0); + final SuiteSetup setup2 = suiteSetup.get(1); + setup2.setArgument(1, "arg"); + // verify + assertThat(getText(setup1)).containsExactly("key1"); + assertThat(getText(setup2)).containsExactly("key2", "", "arg"); + assertThat(settingTable.getSuiteSetups()).hasSize(2); + assertThat(settingTable.getSuiteSetups().get(0)).isSameAs(setup1); + } + + @Test + public void test_twoSuiteSetupDeclarations_shouldReturn_twoSetups() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteSetup setupOne = new SuiteSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + setupOne.addArgument(createToken("arg1")); + + final SuiteSetup setupTwo = new SuiteSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + setupTwo.addArgument(createToken("arg2")); + + settingTable.addSuiteSetup(setupOne); + settingTable.addSuiteSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getSuiteSetups(); + + // verify + assertThat(suiteSetup).hasSize(2); + final SuiteSetup setup1 = suiteSetup.get(0); + assertThat(getText(setup1)).containsExactly("key1", "arg1"); + final SuiteSetup setup2 = suiteSetup.get(1); + assertThat(getText(setup2)).containsExactly("key2", "arg2"); + assertThat(settingTable.getSuiteSetups()).hasSize(2); + } + + @Test + public void test_twoSuiteSetupDeclarations_addArguments_shouldReturn_twoSetupsWithNewArguments() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteSetup setupOne = new SuiteSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + setupOne.addArgument(createToken("arg1")); + + final SuiteSetup setupTwo = new SuiteSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + setupTwo.addArgument(createToken("arg2")); + + settingTable.addSuiteSetup(setupOne); + settingTable.addSuiteSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getSuiteSetups(); + assertThat(suiteSetup).hasSize(2); + final SuiteSetup setup1 = suiteSetup.get(0); + setup1.addArgument(createToken("newArg1")); + final SuiteSetup setup2 = suiteSetup.get(1); + setup2.addArgument(createToken("newArg2")); + + // verify + assertThat(getText(setup1)).containsExactly("key1", "arg1", "newArg1"); + assertThat(getText(setup2)).containsExactly("key2", "arg2", "newArg2"); + assertThat(settingTable.getSuiteSetups()).hasSize(2); + } + + @Test + public void test_twoSuiteSetupDeclarations_modificationOfOneArgument_shouldReturn_twoSetupsWithModifiedArgument() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteSetup setupOne = new SuiteSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + setupOne.addArgument(createToken("arg1")); + + final SuiteSetup setupTwo = new SuiteSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + setupTwo.addArgument(createToken("arg2")); + + settingTable.addSuiteSetup(setupOne); + settingTable.addSuiteSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getSuiteSetups(); + assertThat(suiteSetup).hasSize(2); + final SuiteSetup setup1 = suiteSetup.get(0); + final SuiteSetup setup2 = suiteSetup.get(1); + setup2.getArguments().get(0).setText("mod"); + + // verify + assertThat(getText(setup1)).containsExactly("key1", "arg1"); + assertThat(getText(setup2)).containsExactly("key2", "mod"); + assertThat(settingTable.getSuiteSetups()).hasSize(2); + } + +} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/SuiteTeardownTest.java similarity index 59% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownViewTest.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/SuiteTeardownTest.java index 8ae5221e2..99e9bd058 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteTeardownViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/SuiteTeardownTest.java @@ -1,112 +1,121 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.createToken; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.getText; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.SuiteTeardown; - -public class SuiteTeardownViewTest { - - @Test - public void test_twoSuiteTeardownDeclarations_shouldReturn_commonView() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteTeardown teardownOne = new SuiteTeardown(createToken("")); - teardownOne.setKeywordName(createToken("key1")); - teardownOne.addArgument(createToken("arg1")); - - final SuiteTeardown teardownTwo = new SuiteTeardown(createToken("")); - teardownTwo.setKeywordName(createToken("key2")); - teardownTwo.addArgument(createToken("arg2")); - - settingTable.addSuiteTeardown(teardownOne); - settingTable.addSuiteTeardown(teardownTwo); - - // execute - final List suiteTeardowns = settingTable.getSuiteTeardownsViews(); - - // verify - assertThat(suiteTeardowns).hasSize(1); - final SuiteTeardown common = suiteTeardowns.get(0); - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2"); - assertThat(settingTable.getSuiteTeardowns()).hasSize(2); - } - - @Test - public void test_twoSuiteTeardownDeclarations_addOneArgument_shouldReturn_singleElement() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteTeardown teardownOne = new SuiteTeardown(createToken("")); - teardownOne.setKeywordName(createToken("key1")); - teardownOne.addArgument(createToken("arg1")); - - final SuiteTeardown teardownTwo = new SuiteTeardown(createToken("")); - teardownTwo.setKeywordName(createToken("key2")); - teardownTwo.addArgument(createToken("arg2")); - - settingTable.addSuiteTeardown(teardownOne); - settingTable.addSuiteTeardown(teardownTwo); - - // execute - final List suiteTeardown = settingTable.getSuiteTeardownsViews(); - assertThat(suiteTeardown).hasSize(1); - final SuiteTeardown common = suiteTeardown.get(0); - common.addArgument(createToken("newArg")); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2", "newArg"); - assertThat(settingTable.getSuiteTeardowns()).hasSize(1); - assertThat(settingTable.getSuiteTeardowns().get(0)).isSameAs(common); - } - - @Test - public void test_twoSuiteTeardownDeclarations_modificationOfOneArgument_shouldReturn_twoElementsStill() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final SuiteTeardown teardownOne = new SuiteTeardown(createToken("")); - teardownOne.setKeywordName(createToken("key1")); - teardownOne.addArgument(createToken("arg1")); - - final SuiteTeardown teardownTwo = new SuiteTeardown(createToken("")); - teardownTwo.setKeywordName(createToken("key2")); - teardownTwo.addArgument(createToken("arg2")); - - settingTable.addSuiteTeardown(teardownOne); - settingTable.addSuiteTeardown(teardownTwo); - - // execute - final List suiteTeardowns = settingTable.getSuiteTeardownsViews(); - assertThat(suiteTeardowns).hasSize(1); - final SuiteTeardown common = suiteTeardowns.get(0); - common.getArguments().get(2).setText("mod"); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "mod"); - assertThat(settingTable.getSuiteTeardowns()).hasSize(2); - } -} +/* + * Copyright 2016 Nokia Solutions and Networks + * Licensed under the Apache License, Version 2.0, + * see license.txt file for details. + */ +package org.rf.ide.core.testdata.model.table.setting; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.createToken; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.getText; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; + +public class SuiteTeardownTest { + + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + + @Test + public void test_twoSuiteTeardownDeclarations_shouldReturn_twoTeardowns() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteTeardown teardownOne = new SuiteTeardown(createToken("")); + teardownOne.setKeywordName(createToken("key1")); + teardownOne.addArgument(createToken("arg1")); + + final SuiteTeardown teardownTwo = new SuiteTeardown(createToken("")); + teardownTwo.setKeywordName(createToken("key2")); + teardownTwo.addArgument(createToken("arg2")); + + settingTable.addSuiteTeardown(teardownOne); + settingTable.addSuiteTeardown(teardownTwo); + + // execute + final List suiteTeardowns = settingTable.getSuiteTeardowns(); + + // verify + assertThat(suiteTeardowns).hasSize(2); + final SuiteTeardown teardown1 = suiteTeardowns.get(0); + final SuiteTeardown teardown2 = suiteTeardowns.get(1); + assertThat(getText(teardown1)).containsExactly("key1", "arg1"); + assertThat(getText(teardown2)).containsExactly("key2", "arg2"); + assertThat(settingTable.getSuiteTeardowns()).hasSize(2); + } + + @Test + public void test_twoSuiteTeardownDeclarations_addArguments_shouldReturn_twoTeardownWithNewArguments() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteTeardown teardownOne = new SuiteTeardown(createToken("")); + teardownOne.setKeywordName(createToken("key1")); + teardownOne.addArgument(createToken("arg1")); + + final SuiteTeardown teardownTwo = new SuiteTeardown(createToken("")); + teardownTwo.setKeywordName(createToken("key2")); + teardownTwo.addArgument(createToken("arg2")); + + settingTable.addSuiteTeardown(teardownOne); + settingTable.addSuiteTeardown(teardownTwo); + + // execute + final List suiteTeardown = settingTable.getSuiteTeardowns(); + assertThat(suiteTeardown).hasSize(2); + final SuiteTeardown teardown1 = suiteTeardown.get(0); + final SuiteTeardown teardown2 = suiteTeardown.get(1); + teardown1.addArgument(createToken("newArg1")); + teardown2.addArgument(createToken("newArg2")); + + // verify + assertThat(getText(teardown1)).containsExactly("key1", "arg1", "newArg1"); + assertThat(getText(teardown2)).containsExactly("key2", "arg2", "newArg2"); + assertThat(settingTable.getSuiteTeardowns()).hasSize(2); + assertThat(settingTable.getSuiteTeardowns().get(0)).isSameAs(teardown1); + assertThat(settingTable.getSuiteTeardowns().get(1)).isSameAs(teardown2); + } + + @Test + public void test_twoSuiteTeardownDeclarations_modificationOfOneArgument_shouldReturn_twoTeardownsWithModifiedArgument() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final SuiteTeardown teardownOne = new SuiteTeardown(createToken("")); + teardownOne.setKeywordName(createToken("key1")); + teardownOne.addArgument(createToken("arg1")); + + final SuiteTeardown teardownTwo = new SuiteTeardown(createToken("")); + teardownTwo.setKeywordName(createToken("key2")); + teardownTwo.addArgument(createToken("arg2")); + + settingTable.addSuiteTeardown(teardownOne); + settingTable.addSuiteTeardown(teardownTwo); + + // execute + final List suiteTeardowns = settingTable.getSuiteTeardowns(); + assertThat(suiteTeardowns).hasSize(2); + final SuiteTeardown teardown1 = suiteTeardowns.get(0); + final SuiteTeardown teardown2 = suiteTeardowns.get(1); + teardown2.getArguments().get(0).setText("mod"); + + // verify + assertThat(getText(teardown1)).containsExactly("key1", "arg1"); + assertThat(getText(teardown2)).containsExactly("key2", "mod"); + assertThat(settingTable.getSuiteTeardowns()).hasSize(2); + } +} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestSetupTest.java similarity index 59% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupViewTest.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestSetupTest.java index 1d3cb73dc..1886754d7 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestSetupViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestSetupTest.java @@ -1,112 +1,121 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.createToken; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.getText; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.TestSetup; - -public class TestSetupViewTest { - - @Test - public void test_twoTestSetupDeclarations_shouldReturn_commonView() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestSetup setupOne = new TestSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - setupOne.addArgument(createToken("arg1")); - - final TestSetup setupTwo = new TestSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - setupTwo.addArgument(createToken("arg2")); - - settingTable.addTestSetup(setupOne); - settingTable.addTestSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getTestSetupsViews(); - - // verify - assertThat(suiteSetup).hasSize(1); - final TestSetup common = suiteSetup.get(0); - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2"); - assertThat(settingTable.getTestSetups()).hasSize(2); - } - - @Test - public void test_twoTestSetupDeclarations_addOneArgument_shouldReturn_singleElement() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestSetup setupOne = new TestSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - setupOne.addArgument(createToken("arg1")); - - final TestSetup setupTwo = new TestSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - setupTwo.addArgument(createToken("arg2")); - - settingTable.addTestSetup(setupOne); - settingTable.addTestSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getTestSetupsViews(); - assertThat(suiteSetup).hasSize(1); - final TestSetup common = suiteSetup.get(0); - common.addArgument(createToken("newArg")); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2", "newArg"); - assertThat(settingTable.getTestSetups()).hasSize(1); - assertThat(settingTable.getTestSetups().get(0)).isSameAs(common); - } - - @Test - public void test_twoTestSetupDeclarations_modificationOfOneArgument_shouldReturn_twoElementsStill() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestSetup setupOne = new TestSetup(createToken("")); - setupOne.setKeywordName(createToken("key1")); - setupOne.addArgument(createToken("arg1")); - - final TestSetup setupTwo = new TestSetup(createToken("")); - setupTwo.setKeywordName(createToken("key2")); - setupTwo.addArgument(createToken("arg2")); - - settingTable.addTestSetup(setupOne); - settingTable.addTestSetup(setupTwo); - - // execute - final List suiteSetup = settingTable.getTestSetupsViews(); - assertThat(suiteSetup).hasSize(1); - final TestSetup common = suiteSetup.get(0); - common.getArguments().get(2).setText("mod"); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "mod"); - assertThat(settingTable.getTestSetups()).hasSize(2); - } -} +/* + * Copyright 2016 Nokia Solutions and Networks + * Licensed under the Apache License, Version 2.0, + * see license.txt file for details. + */ +package org.rf.ide.core.testdata.model.table.setting; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.createToken; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.getText; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; + +public class TestSetupTest { + + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + + @Test + public void test_twoTestSetupDeclarations_shouldReturn_twoSetups() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestSetup setupOne = new TestSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + setupOne.addArgument(createToken("arg1")); + + final TestSetup setupTwo = new TestSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + setupTwo.addArgument(createToken("arg2")); + + settingTable.addTestSetup(setupOne); + settingTable.addTestSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getTestSetups(); + + // verify + assertThat(suiteSetup).hasSize(2); + final TestSetup setup1 = suiteSetup.get(0); + assertThat(getText(setup1)).containsExactly("key1", "arg1"); + final TestSetup setup2 = suiteSetup.get(1); + assertThat(getText(setup2)).containsExactly("key2", "arg2"); + assertThat(settingTable.getTestSetups()).hasSize(2); + } + + @Test + public void test_twoTestSetupDeclarations_addArguments_shouldReturn_twoSetupsWithNewArguments() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestSetup setupOne = new TestSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + setupOne.addArgument(createToken("arg1")); + + final TestSetup setupTwo = new TestSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + setupTwo.addArgument(createToken("arg2")); + + settingTable.addTestSetup(setupOne); + settingTable.addTestSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getTestSetups(); + assertThat(suiteSetup).hasSize(2); + final TestSetup setup1 = suiteSetup.get(0); + setup1.addArgument(createToken("newArg1")); + final TestSetup setup2 = suiteSetup.get(1); + setup2.addArgument(createToken("newArg2")); + + // verify + assertThat(getText(setup1)).containsExactly("key1", "arg1", "newArg1"); + assertThat(getText(setup2)).containsExactly("key2", "arg2", "newArg2"); + assertThat(settingTable.getTestSetups()).hasSize(2); + assertThat(settingTable.getTestSetups().get(0)).isSameAs(setup1); + assertThat(settingTable.getTestSetups().get(1)).isSameAs(setup2); + } + + @Test + public void test_twoTestSetupDeclarations_modificationOfOneArgument_shouldReturn_twoSetupsWithModifiedArgument() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestSetup setupOne = new TestSetup(createToken("")); + setupOne.setKeywordName(createToken("key1")); + setupOne.addArgument(createToken("arg1")); + + final TestSetup setupTwo = new TestSetup(createToken("")); + setupTwo.setKeywordName(createToken("key2")); + setupTwo.addArgument(createToken("arg2")); + + settingTable.addTestSetup(setupOne); + settingTable.addTestSetup(setupTwo); + + // execute + final List suiteSetup = settingTable.getTestSetups(); + assertThat(suiteSetup).hasSize(2); + final TestSetup setup1 = suiteSetup.get(0); + final TestSetup setup2 = suiteSetup.get(1); + setup2.getArguments().get(0).setText("mod"); + + // verify + assertThat(getText(setup1)).containsExactly("key1", "arg1"); + assertThat(getText(setup2)).containsExactly("key2", "mod"); + assertThat(settingTable.getTestSetups()).hasSize(2); + } +} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTeardownTest.java similarity index 59% rename from src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownViewTest.java rename to src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTeardownTest.java index 944e9a86e..0f4d97c6c 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTeardownViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTeardownTest.java @@ -1,112 +1,121 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.createToken; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.getText; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.TestTeardown; - -public class TestTeardownViewTest { - - @Test - public void test_twoTestTeardownDeclarations_shouldReturn_commonView() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestTeardown teardownOne = new TestTeardown(createToken("")); - teardownOne.setKeywordName(createToken("key1")); - teardownOne.addArgument(createToken("arg1")); - - final TestTeardown teardownTwo = new TestTeardown(createToken("")); - teardownTwo.setKeywordName(createToken("key2")); - teardownTwo.addArgument(createToken("arg2")); - - settingTable.addTestTeardown(teardownOne); - settingTable.addTestTeardown(teardownTwo); - - // execute - final List testTeardowns = settingTable.getTestTeardownsViews(); - - // verify - assertThat(testTeardowns).hasSize(1); - final TestTeardown common = testTeardowns.get(0); - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2"); - assertThat(settingTable.getTestTeardowns()).hasSize(2); - } - - @Test - public void test_twoTestTeardownDeclarations_addOneArgument_shouldReturn_singleElement() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestTeardown teardownOne = new TestTeardown(createToken("")); - teardownOne.setKeywordName(createToken("key1")); - teardownOne.addArgument(createToken("arg1")); - - final TestTeardown teardownTwo = new TestTeardown(createToken("")); - teardownTwo.setKeywordName(createToken("key2")); - teardownTwo.addArgument(createToken("arg2")); - - settingTable.addTestTeardown(teardownOne); - settingTable.addTestTeardown(teardownTwo); - - // execute - final List testTeardowns = settingTable.getTestTeardownsViews(); - assertThat(testTeardowns).hasSize(1); - final TestTeardown common = testTeardowns.get(0); - common.addArgument(createToken("newArg")); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "arg2", "newArg"); - assertThat(settingTable.getTestTeardowns()).hasSize(1); - assertThat(settingTable.getTestTeardowns().get(0)).isSameAs(common); - } - - @Test - public void test_twoTestTeardownDeclarations_modificationOfOneArgument_shouldReturn_twoElementsStill() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestTeardown teardownOne = new TestTeardown(createToken("")); - teardownOne.setKeywordName(createToken("key1")); - teardownOne.addArgument(createToken("arg1")); - - final TestTeardown teardownTwo = new TestTeardown(createToken("")); - teardownTwo.setKeywordName(createToken("key2")); - teardownTwo.addArgument(createToken("arg2")); - - settingTable.addTestTeardown(teardownOne); - settingTable.addTestTeardown(teardownTwo); - - // execute - final List testTeardowns = settingTable.getTestTeardownsViews(); - assertThat(testTeardowns).hasSize(1); - final TestTeardown common = testTeardowns.get(0); - common.getArguments().get(2).setText("mod"); - - // verify - assertThat(getText(common)).containsExactly("key1", "arg1", "key2", "mod"); - assertThat(settingTable.getTestTeardowns()).hasSize(2); - } -} +/* + * Copyright 2016 Nokia Solutions and Networks + * Licensed under the Apache License, Version 2.0, + * see license.txt file for details. + */ +package org.rf.ide.core.testdata.model.table.setting; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.createToken; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.getText; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; + +public class TestTeardownTest { + + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); + + @Test + public void test_twoTestTeardownDeclarations_shouldReturn_twoTeardowns() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestTeardown teardownOne = new TestTeardown(createToken("")); + teardownOne.setKeywordName(createToken("key1")); + teardownOne.addArgument(createToken("arg1")); + + final TestTeardown teardownTwo = new TestTeardown(createToken("")); + teardownTwo.setKeywordName(createToken("key2")); + teardownTwo.addArgument(createToken("arg2")); + + settingTable.addTestTeardown(teardownOne); + settingTable.addTestTeardown(teardownTwo); + + // execute + final List testTeardowns = settingTable.getTestTeardowns(); + + // verify + assertThat(testTeardowns).hasSize(2); + final TestTeardown teardown1 = testTeardowns.get(0); + final TestTeardown teardown2 = testTeardowns.get(1); + assertThat(getText(teardown1)).containsExactly("key1", "arg1"); + assertThat(getText(teardown2)).containsExactly("key2", "arg2"); + assertThat(settingTable.getTestTeardowns()).hasSize(2); + } + + @Test + public void test_twoTestTeardownDeclarations_addArguments_shouldReturn_twoTeardownsWithNewArguments() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestTeardown teardownOne = new TestTeardown(createToken("")); + teardownOne.setKeywordName(createToken("key1")); + teardownOne.addArgument(createToken("arg1")); + + final TestTeardown teardownTwo = new TestTeardown(createToken("")); + teardownTwo.setKeywordName(createToken("key2")); + teardownTwo.addArgument(createToken("arg2")); + + settingTable.addTestTeardown(teardownOne); + settingTable.addTestTeardown(teardownTwo); + + // execute + final List testTeardowns = settingTable.getTestTeardowns(); + assertThat(testTeardowns).hasSize(2); + final TestTeardown teardown1 = testTeardowns.get(0); + final TestTeardown teardown2 = testTeardowns.get(1); + teardown1.addArgument(createToken("newArg1")); + teardown2.addArgument(createToken("newArg2")); + + // verify + assertThat(getText(teardown1)).containsExactly("key1", "arg1", "newArg1"); + assertThat(getText(teardown2)).containsExactly("key2", "arg2", "newArg2"); + assertThat(settingTable.getTestTeardowns()).hasSize(2); + assertThat(settingTable.getTestTeardowns().get(0)).isSameAs(teardown1); + assertThat(settingTable.getTestTeardowns().get(1)).isSameAs(teardown2); + } + + @Test + public void test_twoTestTeardownDeclarations_modificationOfOneArgument_shouldReturn_twoTeardownsWithModifiedArgument() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestTeardown teardownOne = new TestTeardown(createToken("")); + teardownOne.setKeywordName(createToken("key1")); + teardownOne.addArgument(createToken("arg1")); + + final TestTeardown teardownTwo = new TestTeardown(createToken("")); + teardownTwo.setKeywordName(createToken("key2")); + teardownTwo.addArgument(createToken("arg2")); + + settingTable.addTestTeardown(teardownOne); + settingTable.addTestTeardown(teardownTwo); + + // execute + final List testTeardowns = settingTable.getTestTeardowns(); + assertThat(testTeardowns).hasSize(2); + final TestTeardown teardown1 = testTeardowns.get(0); + final TestTeardown teardown2 = testTeardowns.get(1); + teardown2.getArguments().get(0).setText("mod"); + + // verify + assertThat(getText(teardown1)).containsExactly("key1", "arg1"); + assertThat(getText(teardown2)).containsExactly("key2", "mod"); + assertThat(settingTable.getTestTeardowns()).hasSize(2); + } +} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTimeoutTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTimeoutTest.java index 4fde756a2..6d2f59fb2 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTimeoutTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/TestTimeoutTest.java @@ -5,17 +5,24 @@ */ package org.rf.ide.core.testdata.model.table.setting; -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; +import static org.assertj.core.api.Assertions.assertThat; +import static org.rf.ide.core.testdata.model.table.setting.ModelTokenTestHelper.createToken; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.rf.ide.core.environment.RobotVersion; +import org.rf.ide.core.testdata.model.RobotFile; +import org.rf.ide.core.testdata.model.RobotFileOutput; +import org.rf.ide.core.testdata.model.table.SettingTable; +import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; public class TestTimeoutTest { + private static final RobotVersion ROBOT_VERSION = new RobotVersion(3, 0); private RobotToken decToken; private TestTimeout testable; @@ -70,5 +77,112 @@ public void test_ifCellWillBeAdded_atCommentPosition() { assertThat(elementTokens.get(2).getTypes()).contains(RobotTokenType.SETTING_TEST_TIMEOUT_VALUE); assertThat(elementTokens.get(3)).isSameAs(cmtToken); assertThat(elementTokens.get(3).getTypes()).contains(RobotTokenType.COMMENT); + } + + @Test + public void test_twoTestTimeoutsDeclarations_shouldReturn_twoTimeouts() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestTimeout timeoutOne = new TestTimeout(createToken("")); + timeoutOne.setTimeout("2 minutes"); + timeoutOne.addMessageArgument("arg1_tok1"); + + final TestTimeout timeoutTwo = new TestTimeout(createToken("")); + timeoutTwo.setTimeout("3 minutes"); + timeoutTwo.addMessageArgument("arg1_tok2"); + + settingTable.addTestTimeout(timeoutOne); + settingTable.addTestTimeout(timeoutTwo); + + // execute + final List testTimeout = settingTable.getTestTimeouts(); + + // verify + assertThat(testTimeout).hasSize(2); + assertThat(getText(testTimeout.get(0))).containsExactly("2 minutes", "arg1_tok1"); + assertThat(getText(testTimeout.get(1))).containsExactly("3 minutes", "arg1_tok2"); + assertThat(settingTable.getTestTimeouts()).hasSize(2); + } + + @Test + public void test_twoTestTimeoutsDeclarations_addArguments_shouldReturn_twoTimeoutsWithNewArguments() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestTimeout timeoutOne = new TestTimeout(createToken("")); + timeoutOne.setTimeout("2 minutes"); + timeoutOne.addMessageArgument("arg1_tok1"); + + final TestTimeout timeoutTwo = new TestTimeout(createToken("")); + timeoutTwo.setTimeout("3 minutes"); + timeoutTwo.addMessageArgument("arg1_tok2"); + + settingTable.addTestTimeout(timeoutOne); + settingTable.addTestTimeout(timeoutTwo); + + // execute + final List testTimeout = settingTable.getTestTimeouts(); + assertThat(testTimeout).hasSize(2); + final TestTimeout tTimeout1 = testTimeout.get(0); + final TestTimeout tTimeout2 = testTimeout.get(1); + tTimeout1.addMessageArgument("new_arg1"); + tTimeout2.addMessageArgument("new_arg2"); + + // verify + assertThat(getText(tTimeout1)).containsExactly("2 minutes", "arg1_tok1", "new_arg1"); + assertThat(getText(tTimeout2)).containsExactly("3 minutes", "arg1_tok2", "new_arg2"); + assertThat(settingTable.getTestTimeouts()).hasSize(2); + assertThat(settingTable.getTestTimeouts().get(0)).isSameAs(tTimeout1); + assertThat(settingTable.getTestTimeouts().get(1)).isSameAs(tTimeout2); + } + + @Test + public void test_twoTestTimeoutsDeclarations_modificationOfOneArgument_shouldReturn_twoTimeoutsWithModifiedArgument() { + // prepare + final RobotFileOutput rfo = new RobotFileOutput(ROBOT_VERSION); + final RobotFile robotFile = new RobotFile(rfo); + robotFile.includeSettingTableSection(); + final SettingTable settingTable = robotFile.getSettingTable(); + + final TestTimeout timeoutOne = new TestTimeout(createToken("")); + timeoutOne.setTimeout("2 minutes"); + timeoutOne.addMessageArgument("arg1_tok1"); + + final TestTimeout timeoutTwo = new TestTimeout(createToken("")); + timeoutTwo.setTimeout("3 minutes"); + timeoutTwo.addMessageArgument("arg1_tok2"); + + settingTable.addTestTimeout(timeoutOne); + settingTable.addTestTimeout(timeoutTwo); + + // execute + final List testTimeout = settingTable.getTestTimeouts(); + assertThat(testTimeout).hasSize(2); + final TestTimeout tTimeout1 = testTimeout.get(0); + final TestTimeout tTimeout2 = testTimeout.get(1); + tTimeout2.getMessageArguments().get(0).setText("arg_mod"); + + // verify + assertThat(getText(tTimeout1)).containsExactly("2 minutes", "arg1_tok1"); + assertThat(getText(tTimeout2)).containsExactly("3 minutes", "arg_mod"); + assertThat(settingTable.getTestTimeouts()).hasSize(2); + } + + private List getText(final TestTimeout timeout) { + final List text = new ArrayList<>(); + + if (timeout.getTimeout() != null) { + text.add(timeout.getTimeout().getText()); + } + text.addAll(ModelTokenTestHelper.getText(timeout.getMessageArguments())); + text.addAll(ModelTokenTestHelper.getText(timeout.getComment())); + return text; } } diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationViewTest.java index ccb669298..b063f55d3 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationViewTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/SuiteDocumentationViewTest.java @@ -21,10 +21,12 @@ public class SuiteDocumentationViewTest { + private static final String ROBOT_VERSION = "3.0"; + @Test public void test_twoSuiteDocDeclarations_shouldReturn_commonView() { // prepare - final RobotFile robotFile = new RobotFile(new RobotFileOutput(RobotVersion.from("3.0"))); + final RobotFile robotFile = new RobotFile(new RobotFileOutput(RobotVersion.from(ROBOT_VERSION))); robotFile.includeSettingTableSection(); final SettingTable settingTable = robotFile.getSettingTable(); @@ -52,7 +54,7 @@ public void test_twoSuiteDocDeclarations_shouldReturn_commonView() { @Test public void test_twoSuiteDocumentations_addOneArgument_shouldReturn_singleSuiteDoc() { // prepare - final RobotFile robotFile = new RobotFile(new RobotFileOutput(RobotVersion.from("3.0"))); + final RobotFile robotFile = new RobotFile(new RobotFileOutput(RobotVersion.from(ROBOT_VERSION))); robotFile.includeSettingTableSection(); final SettingTable settingTable = robotFile.getSettingTable(); @@ -83,7 +85,7 @@ public void test_twoSuiteDocumentations_addOneArgument_shouldReturn_singleSuiteD @Test public void test_twoSuiteDocumentations_modificationOfOneArgument_shouldReturn_twoSuiteDocsStill() { // prepare - final RobotFile robotFile = new RobotFile(new RobotFileOutput(RobotVersion.from("3.0"))); + final RobotFile robotFile = new RobotFile(new RobotFileOutput(RobotVersion.from(ROBOT_VERSION))); robotFile.includeSettingTableSection(); final SettingTable settingTable = robotFile.getSettingTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutViewTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutViewTest.java deleted file mode 100644 index 2536e9884..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/setting/views/TestTimeoutViewTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2016 Nokia Solutions and Networks - * Licensed under the Apache License, Version 2.0, - * see license.txt file for details. - */ -package org.rf.ide.core.testdata.model.table.setting.views; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.rf.ide.core.testdata.model.table.setting.views.ModelTokenTestHelper.createToken; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.environment.RobotVersion; -import org.rf.ide.core.testdata.model.RobotFile; -import org.rf.ide.core.testdata.model.RobotFileOutput; -import org.rf.ide.core.testdata.model.table.SettingTable; -import org.rf.ide.core.testdata.model.table.setting.TestTimeout; - -public class TestTimeoutViewTest { - - @Test - public void test_twoTestTimeoutsDeclarations_shouldReturn_commonView() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestTimeout timeoutOne = new TestTimeout(createToken("")); - timeoutOne.setTimeout("2 minutes"); - timeoutOne.addMessageArgument("arg1_tok1"); - - final TestTimeout timeoutTwo = new TestTimeout(createToken("")); - timeoutTwo.setTimeout("3 minutes"); - timeoutTwo.addMessageArgument("arg1_tok2"); - - settingTable.addTestTimeout(timeoutOne); - settingTable.addTestTimeout(timeoutTwo); - - // execute - final List testTimeout = settingTable.getTestTimeoutsViews(); - - // verify - assertThat(testTimeout).hasSize(1); - assertThat(getText(testTimeout.get(0))).containsExactly("2 minutes", "arg1_tok1", "3 minutes", "arg1_tok2"); - assertThat(settingTable.getTestTimeouts()).hasSize(2); - } - - @Test - public void test_twoTestTimeoutsDeclarations_addOneMessageArgument_shouldReturn_singleTimeout() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestTimeout timeoutOne = new TestTimeout(createToken("")); - timeoutOne.setTimeout("2 minutes"); - timeoutOne.addMessageArgument("arg1_tok1"); - - final TestTimeout timeoutTwo = new TestTimeout(createToken("")); - timeoutTwo.setTimeout("3 minutes"); - timeoutTwo.addMessageArgument("arg1_tok2"); - - settingTable.addTestTimeout(timeoutOne); - settingTable.addTestTimeout(timeoutTwo); - - // execute - final List testTimeout = settingTable.getTestTimeoutsViews(); - assertThat(testTimeout).hasSize(1); - final TestTimeout tTimeout = testTimeout.get(0); - tTimeout.addMessageArgument("new_arg1"); - - // verify - assertThat(getText(tTimeout)).containsExactly("2 minutes", "arg1_tok1", "3 minutes", "arg1_tok2", "new_arg1"); - assertThat(settingTable.getTestTimeouts()).hasSize(1); - assertThat(settingTable.getTestTimeouts().get(0)).isSameAs(tTimeout); - } - - @Test - public void test_twoTestTimeoutsDeclarations_modificationOfOneArgument_shouldReturn_stillTwoTimeouts() { - // prepare - final RobotFileOutput rfo = new RobotFileOutput(new RobotVersion(2, 9)); - final RobotFile robotFile = new RobotFile(rfo); - robotFile.includeSettingTableSection(); - final SettingTable settingTable = robotFile.getSettingTable(); - - final TestTimeout timeoutOne = new TestTimeout(createToken("")); - timeoutOne.setTimeout("2 minutes"); - timeoutOne.addMessageArgument("arg1_tok1"); - - final TestTimeout timeoutTwo = new TestTimeout(createToken("")); - timeoutTwo.setTimeout("3 minutes"); - timeoutTwo.addMessageArgument("arg1_tok2"); - - settingTable.addTestTimeout(timeoutOne); - settingTable.addTestTimeout(timeoutTwo); - - // execute - final List testTimeout = settingTable.getTestTimeoutsViews(); - assertThat(testTimeout).hasSize(1); - final TestTimeout tTimeout = testTimeout.get(0); - tTimeout.getMessageArguments().get(2).setText("arg_mod"); - - // verify - assertThat(getText(tTimeout)).containsExactly("2 minutes", "arg1_tok1", "3 minutes", "arg_mod"); - assertThat(settingTable.getTestTimeouts()).hasSize(2); - } - - private List getText(final TestTimeout timeout) { - final List text = new ArrayList<>(); - - if (timeout.getTimeout() != null) { - text.add(timeout.getTimeout().getText()); - } - text.addAll(ModelTokenTestHelper.getText(timeout.getMessageArguments())); - text.addAll(ModelTokenTestHelper.getText(timeout.getComment())); - return text; - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/testcases/TestCaseRemoveElementsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/testcases/TestCaseRemoveElementsTest.java index 7fb2ad07d..74fdf0d30 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/testcases/TestCaseRemoveElementsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/model/table/testcases/TestCaseRemoveElementsTest.java @@ -29,7 +29,7 @@ public class TestCaseRemoveElementsTest { @BeforeEach public void setUp() { - final RobotFileOutput out = new RobotFileOutput(RobotVersion.from("2.9.0")); + final RobotFileOutput out = new RobotFileOutput(RobotVersion.from("3.0.0")); out.getFileModel().includeTestCaseTableSection(); testCase = new TestCase(new RobotToken()); out.getFileModel().getTestCaseTable().addTest(testCase); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/postfixes/ForContinueForItemIssueFixerOutputCheckTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/postfixes/ForContinueForItemIssueFixerOutputCheckTest.java index fa1182bc6..41bb81b04 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/postfixes/ForContinueForItemIssueFixerOutputCheckTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/postfixes/ForContinueForItemIssueFixerOutputCheckTest.java @@ -350,7 +350,7 @@ private RobotFile getModelFile(final String fileName) throws Exception { when(projectHolder.shouldBeParsed(file)).thenReturn(true); // execute - final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(2, 9)); + final RobotParser parser = new RobotParser(projectHolder, new RobotVersion(3, 0)); final List parsed = parser.parse(file); // verify diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizerTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizerTest.java deleted file mode 100644 index 40638bc44..000000000 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/read/recognizer/settings/MetaRecognizerTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* -* Copyright 2018 Nokia Solutions and Networks -* Licensed under the Apache License, Version 2.0, -* see license.txt file for details. -*/ -package org.rf.ide.core.testdata.text.read.recognizer.settings; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; - -import org.junit.jupiter.api.Test; -import org.rf.ide.core.test.helpers.CombinationGenerator; -import org.rf.ide.core.testdata.text.read.recognizer.ATokenRecognizer; -import org.rf.ide.core.testdata.text.read.recognizer.RobotToken; -import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType; - - -public class MetaRecognizerTest { - - private final MetaRecognizer recognizer = new MetaRecognizer(); - - @Test - public void patternTest() { - assertThat(recognizer.getPattern().pattern()) - .isEqualTo("[ ]?(" + ATokenRecognizer.createUpperLowerCaseWord("Meta") + ":)"); - } - - @Test - public void producedTypeTest() { - assertThat(recognizer.getProducedType()).isEqualTo(RobotTokenType.SETTING_METADATA_DECLARATION); - } - - @Test - public void metaColonWord_allCombinations() { - final List combinations = new CombinationGenerator().combinations("Meta:"); - for (final String comb : combinations) { - final StringBuilder textOfHeader = new StringBuilder(comb); - - assertThat(recognizer.hasNext(textOfHeader, 1, 0)).isTrue(); - final RobotToken token = recognizer.next(); - assertThat(token.getStartColumn()).isEqualTo(0); - assertThat(token.getLineNumber()).isEqualTo(1); - assertThat(token.getEndColumn()).isEqualTo(textOfHeader.length()); - assertThat(token.getText().toString()).isEqualTo(textOfHeader.toString()); - assertThat(token.getTypes()).containsExactly(recognizer.getProducedType()); - } - } - - @Test - public void twoSpacesAndMetaColonThenWord() { - final StringBuilder text = new StringBuilder(" Meta:"); - final StringBuilder d = new StringBuilder(" ").append(text); - - assertThat(recognizer.hasNext(d, 1, 0)).isTrue(); - final RobotToken token = recognizer.next(); - assertThat(token.getStartColumn()).isEqualTo(1); - assertThat(token.getLineNumber()).isEqualTo(1); - assertThat(token.getEndColumn()).isEqualTo(d.length()); - assertThat(token.getText().toString()).isEqualTo(text.toString()); - assertThat(token.getTypes()).containsExactly(recognizer.getProducedType()); - } - - @Test - public void singleSpaceAndMetaColonThenWord() { - final StringBuilder text = new StringBuilder(" Meta:"); - final StringBuilder d = new StringBuilder(text).append("C"); - - assertThat(recognizer.hasNext(d, 1, 0)).isTrue(); - final RobotToken token = recognizer.next(); - assertThat(token.getStartColumn()).isEqualTo(0); - assertThat(token.getLineNumber()).isEqualTo(1); - assertThat(token.getEndColumn()).isEqualTo(text.length()); - assertThat(token.getText().toString()).isEqualTo(text.toString()); - assertThat(token.getTypes()).containsExactly(recognizer.getProducedType()); - } - - @Test - public void singleMetaColonThenLetterCWord() { - final StringBuilder text = new StringBuilder("Meta:"); - final StringBuilder d = new StringBuilder(text).append("C"); - - assertThat(recognizer.hasNext(d, 1, 0)).isTrue(); - final RobotToken token = recognizer.next(); - assertThat(token.getStartColumn()).isEqualTo(0); - assertThat(token.getLineNumber()).isEqualTo(1); - assertThat(token.getEndColumn()).isEqualTo(text.length()); - assertThat(token.getText().toString()).isEqualTo(text.toString()); - assertThat(token.getTypes()).containsExactly(recognizer.getProducedType()); - } - - @Test - public void singleMetaColonWord() { - final StringBuilder text = new StringBuilder("Meta:"); - - assertThat(recognizer.hasNext(text, 1, 0)).isTrue(); - final RobotToken token = recognizer.next(); - assertThat(token.getStartColumn()).isEqualTo(0); - assertThat(token.getLineNumber()).isEqualTo(1); - assertThat(token.getEndColumn()).isEqualTo(text.length()); - assertThat(token.getText().toString()).isEqualTo(text.toString()); - assertThat(token.getTypes()).containsExactly(recognizer.getProducedType()); - } -} diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/TestCaseNotChangedDumperTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/TestCaseNotChangedDumperTest.java index e12824d75..d31af7014 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/TestCaseNotChangedDumperTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/TestCaseNotChangedDumperTest.java @@ -20,6 +20,8 @@ public class TestCaseNotChangedDumperTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void dumpAsItIsInFile(final FileFormat format) throws Exception { @@ -29,7 +31,7 @@ public void dumpAsItIsInFile(final FileFormat format) throws Exception { final String fileContent = DumperTestHelper.getINSTANCE().readWithLineSeparatorPresave(inputFile); final RobotFile modelFile = RobotModelTestProvider.getModelFile(fileContent, format, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser(ROBOT_VERSION)); final RobotFileDumper dumper = new RobotFileDumper(); final DumpContext ctx = new DumpContext(null, false); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordArgumentsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordArgumentsTest.java index 4d2413670..324f482ce 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordArgumentsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordArgumentsTest.java @@ -17,6 +17,8 @@ public class CreationOfKeywordArgumentsTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordArguments_withoutKeywordName_andArgumentsDecOnly( @@ -35,7 +37,7 @@ private void test_emptyFile_argsDecOnly(final String fileNameWithoutExt, final S final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -69,7 +71,7 @@ private void test_emptyFile_CommentsOnly(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -107,7 +109,7 @@ private void test_emptyFile_createKeyArgs_3ArgsOnly(final String fileNameWithout final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -147,7 +149,7 @@ private void test_emptyFile_keywordArgsCreation_plus3Args_andComment(final Strin final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordDocumentationTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordDocumentationTest.java index c9b74cecf..8585e13c0 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordDocumentationTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordDocumentationTest.java @@ -19,13 +19,15 @@ public class CreationOfKeywordDocumentationTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordCaseDocumentation_withName_andThreeLinesOfDocumentation( final FileFormat format) throws Exception { // prepare final String filePath = convert("KeywordDocumentationWithThreeLinesCreation", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -62,7 +64,7 @@ private void test_onlyKeyDoc_decIncluded(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -96,7 +98,7 @@ private void test_keyDoc_withCommentOnly(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -134,7 +136,7 @@ private void test_docOnlyWith3Words(final String fileNameWithoutExt, final Strin final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -172,7 +174,7 @@ private void test_keyDoc_withDoc3Words_andComment(final String fileNameWithoutEx final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableOneStepTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableOneStepTest.java index f87518281..d17b2eba9 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableOneStepTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableOneStepTest.java @@ -33,7 +33,7 @@ public IExecutableStepsHolder getExecutableWithoutName() { } private UserKeyword createModelWithOneKeywordInside() { - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("3.0"); modelFile.includeKeywordTableSection(); final KeywordTable keywordTable = modelFile.getKeywordTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableThreeStepsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableThreeStepsTest.java index 471d4bdf7..d9aaa5257 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableThreeStepsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordExecutableThreeStepsTest.java @@ -33,7 +33,7 @@ public IExecutableStepsHolder getExecutableWithoutName() { } private UserKeyword createModelWithOneKeywordInside() { - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("3.0"); modelFile.includeKeywordTableSection(); final KeywordTable keywordTable = modelFile.getKeywordTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordReturnTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordReturnTest.java index 419068006..b28a75df7 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordReturnTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordReturnTest.java @@ -17,6 +17,8 @@ public class CreationOfKeywordReturnTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordReturn_withoutKeywordName_andReturnDecOnly(final FileFormat format) @@ -35,7 +37,7 @@ private void test_returnDecOnly(final String fileNameWithoutExt, final String us final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -69,7 +71,7 @@ private void test_returnWithCommentOnly(final String fileNameWithoutExt, final S final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -107,7 +109,7 @@ private void test_return_With3Values(final String fileNameWithoutExt, final Stri final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -145,7 +147,7 @@ private void test_returnWith_3ValuesAndComment(final String fileNameWithoutExt, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTableHeaderTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTableHeaderTest.java index e3bb81d87..9c47e3140 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTableHeaderTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTableHeaderTest.java @@ -16,12 +16,14 @@ public class CreationOfKeywordTableHeaderTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordHeaderOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("KeywordsHeaderOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -36,7 +38,7 @@ public void test_emptyFile_and_thanCreateKeywordHeader_withTwoNamedColumns(final throws Exception { // prepare final String fileName = convert("KeywordsHeaderWithColumns", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -58,7 +60,7 @@ public void test_emptyFile_and_thanCreateKeywordHeader_withTwoCommentTokens(fina throws Exception { // prepare final String fileName = convert("KeywordsHeaderWithComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -80,7 +82,7 @@ public void test_emptyFile_and_thanCreateKeywordHeader_withTwoNamedColumns_and_w final FileFormat format) throws Exception { // prepare final String fileName = convert("KeywordsHeaderWithColumnsAndComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTagsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTagsTest.java index 709590984..ca7b1f531 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTagsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTagsTest.java @@ -17,6 +17,8 @@ public class CreationOfKeywordTagsTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordTags_withoutKeywordName_andTagsDecOnly(final FileFormat format) @@ -35,7 +37,7 @@ private void test_tagsDecOnly(final String fileNameWithoutExt, final String user final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -69,7 +71,7 @@ private void test_tagsDec_andComment(final String fileNameWithoutExt, final Stri final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -107,7 +109,7 @@ private void test_tags_withTagsAnd3Tags(final String fileNameWithoutExt, final S final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -145,7 +147,7 @@ private void test_tags_with3Tags_andComment(final String fileNameWithoutExt, fin final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTeardownTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTeardownTest.java index 7fd4d7c3a..00c60f1bb 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTeardownTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTeardownTest.java @@ -17,6 +17,8 @@ public class CreationOfKeywordTeardownTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordTeardown_withoutKeywordName_andTeardownDecOnly( @@ -35,7 +37,7 @@ private void test_teardownDecOnly(final String fileNameWithoutExt, final String final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -69,7 +71,7 @@ private void test_teardownWithCommentOnly(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -107,7 +109,7 @@ private void test_teardownWithExec(final String fileNameWithoutExt, final String final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -144,7 +146,7 @@ private void test_teardownWithExec_andComment(final String fileNameWithoutExt, f throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -183,7 +185,7 @@ private void test_teardownWithExec_and3Args(final String fileNameWithoutExt, fin final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -224,7 +226,7 @@ private void test_teardownWithExec_and3Args_andComment(final String fileNameWith final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTimeoutTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTimeoutTest.java index f24996677..4e9da3c60 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTimeoutTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfKeywordTimeoutTest.java @@ -17,6 +17,8 @@ public class CreationOfKeywordTimeoutTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateKeywordTimeout_withoutKeywordName_andTimeoutDecOnly( @@ -35,7 +37,7 @@ private void test_timeoutDecOnly(final String fileNameWithoutExt, final String u final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -69,7 +71,7 @@ private void test_timeoutDec_withCommentOnly(final String fileNameWithoutExt, fi final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -107,7 +109,7 @@ private void test_timeoutDec_withComment_andValue(final String fileNameWithoutEx final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -145,7 +147,7 @@ private void test_timeoutDec_withComment_andValue_andComment(final String fileNa final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -184,7 +186,7 @@ private void test_timeoutDec_withComment_andValue_and3MsgArgs(final String fileN final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); @@ -225,7 +227,7 @@ private void test_timeoutDec_withComment_andValue_and3MsgArgs_andComment(final S final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeKeywordTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfThreeKeywordExecutablesWithOneStepTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfThreeKeywordExecutablesWithOneStepTest.java index bbe8b7cc8..6f32842c0 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfThreeKeywordExecutablesWithOneStepTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/keywords/creation/CreationOfThreeKeywordExecutablesWithOneStepTest.java @@ -53,7 +53,7 @@ private List>> execUnits = new ArrayList<>( 0); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("3.0"); modelFile.includeKeywordTableSection(); final KeywordTable keywordTable = modelFile.getKeywordTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingTableHeaderTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingTableHeaderTest.java index cb8bb0a8b..b4a4720c0 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingTableHeaderTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingTableHeaderTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingTableHeaderTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateSettingHeaderOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("SettingsHeaderOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -36,7 +38,7 @@ public void test_emptyFile_and_thanCreateSettingHeader_withTwoNamedColumns(final throws Exception { // prepare final String fileName = convert("SettingsHeaderWithColumns", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -58,7 +60,7 @@ public void test_emptyFile_and_thanCreateSettingHeader_withTwoCommentTokens(fina throws Exception { // prepare final String fileName = convert("SettingsHeaderWithComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -80,7 +82,7 @@ public void test_emptyFile_and_thanCreateSettingHeader_withTwoNamedColumns_and_w final FileFormat format) throws Exception { // prepare final String fileName = convert("SettingsHeaderWithColumnsAndComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsDefaultTagsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsDefaultTagsTest.java index e53a80eb8..3ad3a5681 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsDefaultTagsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsDefaultTagsTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsDefaultTagsTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateDefaultTags(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyDefaultTagsDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -36,7 +38,7 @@ public void test_emptyFile_and_thanCreateDefaultTags(final FileFormat format) th @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateDefaultTagsWithThreeTags(final FileFormat format) throws Exception { // prepare - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); final String fileName = convert("DefaultTagsWithThreeTagsOnly", format); // test data prepare @@ -62,7 +64,7 @@ public void test_emptyFile_and_thanCreateDefaultTagsWithThreeTags(final FileForm public void test_emptyFile_and_thanCreateDefaultTagsWithThreeComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("DefaultTagsWithThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -88,7 +90,7 @@ public void test_emptyFile_and_thanCreateDefaultTagsWithThreeCommentsAndTags(fin throws Exception { // prepare final String fileName = convert("DefaultTagsWithThreeTagsAndCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsForceTagsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsForceTagsTest.java index 37cab47e2..76973fba6 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsForceTagsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsForceTagsTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsForceTagsTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateForceTags(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyForceTagsDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateForceTags(final FileFormat format) thro public void test_emptyFile_and_thanCreateForceTagsWithThreeTags(final FileFormat format) throws Exception { // prepare final String fileName = convert("ForceTagsWithThreeTagsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -62,7 +64,7 @@ public void test_emptyFile_and_thanCreateForceTagsWithThreeTags(final FileFormat public void test_emptyFile_and_thanCreateForceTagsWithThreeComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("ForceTagsWithThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -88,7 +90,7 @@ public void test_emptyFile_and_thanCreateForceTagsWithThreeCommentsAndTags(final throws Exception { // prepare final String fileName = convert("ForceTagsWithThreeTagsAndCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsLibraryImportTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsLibraryImportTest.java index a9b7a286c..f26ebd9c9 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsLibraryImportTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsLibraryImportTest.java @@ -17,12 +17,14 @@ public class CreationOfSettingsLibraryImportTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateLibraryImport(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyLibraryDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -38,7 +40,7 @@ public void test_emptyFile_and_thanCreateLibraryImport(final FileFormat format) public void test_emptyFile_and_thanCreateLibraryImport_withName(final FileFormat format) throws Exception { // prepare final String fileName = convert("LibraryDeclarationWithLibraryNameOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -58,7 +60,7 @@ public void test_emptyFile_and_thanCreateLibraryImport_withNameAnd_ThreeCommentT throws Exception { // prepare final String fileName = convert("LibraryDeclarationWithLibraryNameAndThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -88,7 +90,7 @@ public void test_emptyFile_and_thanCreateLibraryImport_with_ThreeCommentTokens(f throws Exception { // prepare final String fileName = convert("LibraryDeclarationWithThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -115,7 +117,7 @@ public void test_emptyFile_and_thanCreateLibraryImport_withNameAnd_ThreeArgument throws Exception { // prepare final String fileName = convert("LibraryDeclarationWithLibraryNameAndThreeArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -145,7 +147,7 @@ public void test_emptyFile_and_thanCreateLibraryImport_withNameAnd_ThreeArgument final FileFormat format) throws Exception { // prepare final String fileName = convert("LibraryDeclarationWithLibraryNameAndThreeArgsThreeCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -185,7 +187,7 @@ public void test_emptyFile_and_thanCreateLibraryImport_withNameAnd_ThreeArgument final FileFormat format) throws Exception { // prepare final String fileName = convert("LibraryDeclarationWithLibraryNameAndThreeArgsThreeCommentsAliasOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsMetadataTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsMetadataTest.java index 59394dd16..6cb916540 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsMetadataTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsMetadataTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsMetadataTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateMetadataDeclarationOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyMetadataDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -38,7 +40,7 @@ public void test_emptyFile_and_thanCreateMetadata_with_ThreeCommentTokens(final throws Exception { // prepare final String fileName = convert("MetadataWithThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -64,7 +66,7 @@ public void test_emptyFile_and_thanCreateMetadata_with_ThreeCommentTokens(final public void test_emptyFile_and_CreateMetadata_withKeyOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("MetadataWithKeyOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_and_CreateMetadata_withKeyOnly(final FileFormat forma public void test_emptyFile_and_CreateMetadata_withKey_andThreeValues(final FileFormat format) throws Exception { // prepare final String fileName = convert("MetadataWithKeyAndThreeValuesOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -114,7 +116,7 @@ public void test_emptyFile_and_CreateMetadata_withKey_andThreeValues(final FileF public void test_emptyFile_and_CreateMetadata_withKey_andComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("MetadataWithKeyAndCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -145,7 +147,7 @@ public void test_emptyFile_and_CreateMetadata_withKey_andThreeValuesAndComments( throws Exception { // prepare final String fileName = convert("MetadataWithKeyAndThreeValuesCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsResourceImportTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsResourceImportTest.java index b5784f9b6..2a16e4f10 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsResourceImportTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsResourceImportTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsResourceImportTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateResourceImport(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyResourceImportDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateResourceImport(final FileFormat format) public void test_emptyFile_and_thanCreateResourceImport_withName(final FileFormat format) throws Exception { // prepare final String fileName = convert("ResourceDeclarationWithResourceNameOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -57,7 +59,7 @@ public void test_emptyFile_and_thanCreateResourceImport_with_ThreeCommentTokens( throws Exception { // prepare final String fileName = convert("ResourceDeclarationWithThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_and_thanCreateResourceImport_with_resName_andThreeCom throws Exception { // prepare final String fileName = convert("ResourceDeclarationWithResNameAndThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteDocumentationTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteDocumentationTest.java index d7e1a8bd6..0269e907b 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteDocumentationTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteDocumentationTest.java @@ -17,12 +17,14 @@ public class CreationOfSettingsSuiteDocumentationTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateSuiteDoc(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptySuiteDocumentationDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -38,7 +40,7 @@ public void test_emptyFile_and_thanCreateSuiteDoc(final FileFormat format) throw public void test_emptyFile_createSuiteDoc_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteDocumentationDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -64,7 +66,7 @@ public void test_emptyFile_createSuiteDoc_andAddComments(final FileFormat format public void test_emptyFile_createSuiteDoc_withText(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteDocumentationDeclarationWithTextOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -90,7 +92,7 @@ public void test_emptyFile_createSuiteDoc_withText(final FileFormat format) thro public void test_emptyFile_createSuiteDoc_withMultipleLines(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptySuiteDocumentationThreeLines", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -108,7 +110,7 @@ public void test_emptyFile_createSuiteDoc_withMultipleLines(final FileFormat for public void test_emptyFile_createSuiteDoc_withTextAndComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteDocumentationDeclarationWithTextAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteSetupTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteSetupTest.java index b81548b1e..a7da4142c 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteSetupTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteSetupTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsSuiteSetupTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateSuiteSetup(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptySuiteSetupDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateSuiteSetup(final FileFormat format) thr public void test_emptyFile_createSuiteSetup_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteSetupDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_createSuiteSetup_andAddComments(final FileFormat form public void test_emptyFile_createSuiteSetup_andKeywordOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteSetupDeclarationWithKeywordOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_createSuiteSetup_andKeywordOnly(final FileFormat form public void test_emptyFile_createSuiteSetup_andKeyword_andComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteSetupDeclarationWithKeywordCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -115,7 +117,7 @@ public void test_emptyFile_createSuiteSetup_andKeyword_andComments(final FileFor public void test_emptyFile_createSuiteSetup_andKeyword_andThreeArgs(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteSetupDeclarationWithKeyword3ArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -147,7 +149,7 @@ public void test_emptyFile_createSuiteSetup_andKeyword_andThreeArgs_andComment(f throws Exception { // prepare final String fileName = convert("SuiteSetupDeclarationWithKeyword3ArgsAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteTeardownTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteTeardownTest.java index d4a890e3f..281f54c95 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteTeardownTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsSuiteTeardownTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsSuiteTeardownTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateSuiteTeardown(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptySuiteTeardownDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateSuiteTeardown(final FileFormat format) public void test_emptyFile_createSuiteTeardown_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteTeardownDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_createSuiteTeardown_andAddComments(final FileFormat f public void test_emptyFile_createSuiteTeardown_andKeywordOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteTeardownDeclarationWithKeywordOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_createSuiteTeardown_andKeywordOnly(final FileFormat f public void test_emptyFile_createSuiteTeardown_andKeyword_andComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteTeardownDeclarationWithKeywordCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -115,7 +117,7 @@ public void test_emptyFile_createSuiteTeardown_andKeyword_andComments(final File public void test_emptyFile_createSuiteTeardown_andKeyword_andThreeArgs(final FileFormat format) throws Exception { // prepare final String fileName = convert("SuiteTeardownDeclarationWithKeyword3ArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -147,7 +149,7 @@ public void test_emptyFile_createSuiteTeardown_andKeyword_andThreeArgs_andCommen throws Exception { // prepare final String fileName = convert("SuiteTeardownDeclarationWithKeyword3ArgsAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTemplateTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTemplateTest.java index 6e2e7ecf8..f26cfd84e 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTemplateTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTemplateTest.java @@ -16,13 +16,15 @@ public class CreationOfSettingsTaskTemplateTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_createTaskTemplate_withKeywordName_andThreeUnwanted_andComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("TaskTemplateDeclarationWithKeyword3UnwantedArgsCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTimeoutTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTimeoutTest.java index e086fc224..11a5591e3 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTimeoutTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTaskTimeoutTest.java @@ -16,13 +16,15 @@ public class CreationOfSettingsTaskTimeoutTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_createTaskTemplate_andTimeoutValue_withThreeMessages_andComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("TaskTimeoutDeclarationWithTimeoutAndMsgAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestSetupTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestSetupTest.java index 7e4f1b646..33da8e354 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestSetupTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestSetupTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsTestSetupTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestSetup(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyTestSetupDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateTestSetup(final FileFormat format) thro public void test_emptyFile_createTestSetup_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestSetupDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_createTestSetup_andAddComments(final FileFormat forma public void test_emptyFile_createTestSetup_andKeywordOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestSetupDeclarationWithKeywordOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_createTestSetup_andKeywordOnly(final FileFormat forma public void test_emptyFile_createTestSetup_andKeyword_andComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestSetupDeclarationWithKeywordCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -115,7 +117,7 @@ public void test_emptyFile_createTestSetup_andKeyword_andComments(final FileForm public void test_emptyFile_createTestSetup_andKeyword_andThreeArgs(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestSetupDeclarationWithKeyword3ArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -147,7 +149,7 @@ public void test_emptyFile_createTestSetup_andKeyword_andThreeArgs_andComment(fi throws Exception { // prepare final String fileName = convert("TestSetupDeclarationWithKeyword3ArgsAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTeardownTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTeardownTest.java index 84b25f1fe..47cfae993 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTeardownTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTeardownTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsTestTeardownTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestTeardown(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyTestTeardownDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateTestTeardown(final FileFormat format) t public void test_emptyFile_createTestTeardown_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTeardownDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_createTestTeardown_andAddComments(final FileFormat fo public void test_emptyFile_createTestTeardown_andKeywordOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTeardownDeclarationWithKeywordOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_createTestTeardown_andKeywordOnly(final FileFormat fo public void test_emptyFile_createTestTeardown_andKeyword_andComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTeardownDeclarationWithKeywordCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -115,7 +117,7 @@ public void test_emptyFile_createTestTeardown_andKeyword_andComments(final FileF public void test_emptyFile_createTestTeardown_andKeyword_andThreeArgs(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTeardownDeclarationWithKeyword3ArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -147,7 +149,7 @@ public void test_emptyFile_createTestTeardown_andKeyword_andThreeArgs_andComment throws Exception { // prepare final String fileName = convert("TestTeardownDeclarationWithKeyword3ArgsAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTemplateTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTemplateTest.java index ce87e5b1d..7ce03ba08 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTemplateTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTemplateTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsTestTemplateTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestTemplate(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyTestTemplateDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateTestTemplate(final FileFormat format) t public void test_emptyFile_createTestTemplate_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTemplateDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_createTestTemplate_andAddComments(final FileFormat fo public void test_emptyFile_createTestTemplate_withKeywordName(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTemplateDeclarationWithKeywordOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_createTestTemplate_withKeywordName(final FileFormat f public void test_emptyFile_createTestTemplate_withKeywordName_andComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTemplateDeclarationWithKeywordCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -116,7 +118,7 @@ public void test_emptyFile_createTestTemplate_withKeywordName_andThreeUnwanted(f throws Exception { // prepare final String fileName = convert("TestTemplateDeclarationWithKeyword3UnwantedArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -149,7 +151,7 @@ public void test_emptyFile_createTestTemplate_withKeywordName_andThreeUnwanted_a throws Exception { // prepare final String fileName = convert("TestTemplateDeclarationWithKeyword3UnwantedArgsCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTimeoutTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTimeoutTest.java index 7775c6a85..6f4889542 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTimeoutTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsTestTimeoutTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsTestTimeoutTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestTemplate(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyTestTimeoutDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateTestTemplate(final FileFormat format) t public void test_emptyFile_createTestTemplate_andAddComments(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTimeoutDeclarationWithCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_createTestTemplate_andAddComments(final FileFormat fo public void test_emptyFile_createTestTemplate_andTimeoutValue(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTimeoutDeclarationWithTimeoutOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -84,7 +86,7 @@ public void test_emptyFile_createTestTemplate_andTimeoutValue(final FileFormat f public void test_emptyFile_createTestTemplate_andTimeoutValue_andComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestTimeoutDeclarationWithTimeoutAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -116,7 +118,7 @@ public void test_emptyFile_createTestTemplate_andTimeoutValue_withThreeMessages( throws Exception { // prepare final String fileName = convert("TestTimeoutDeclarationWithTimeoutAndMsgOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -148,7 +150,7 @@ public void test_emptyFile_createTestTemplate_andTimeoutValue_withThreeMessages_ throws Exception { // prepare final String fileName = convert("TestTimeoutDeclarationWithTimeoutAndMsgAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsVariablesImportTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsVariablesImportTest.java index 337a7e069..31bf1bc04 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsVariablesImportTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/creation/CreationOfSettingsVariablesImportTest.java @@ -16,12 +16,14 @@ public class CreationOfSettingsVariablesImportTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateVariablesImport(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyVariableDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -37,7 +39,7 @@ public void test_emptyFile_and_thanCreateVariablesImport(final FileFormat format public void test_emptyFile_and_thanCreateVariablesImport_withName(final FileFormat format) throws Exception { // prepare final String fileName = convert("VariableDeclarationWithVariableNameOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -57,7 +59,7 @@ public void test_emptyFile_and_thanCreateVariablesImport_withNameAnd_ThreeCommen throws Exception { // prepare final String fileName = convert("VariableDeclarationWithPathNameAndThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -87,7 +89,7 @@ public void test_emptyFile_and_thanCreateVariablesImport_with_ThreeCommentTokens throws Exception { // prepare final String fileName = convert("VariableDeclarationWithThreeCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -114,7 +116,7 @@ public void test_emptyFile_and_thanCreateVariablesImport_withNameAnd_ThreeArgume throws Exception { // prepare final String fileName = convert("VariableDeclarationWithPathNameAndThreeArgsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); @@ -144,7 +146,7 @@ public void test_emptyFile_and_thanCreateVariablesImport_withNameAnd_ThreeArgume final FileFormat format) throws Exception { // prepare final String fileName = convert("VariableDeclarationWithPathNameAndThreeArgsThreeCommentsOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeSettingTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/update/UpdateOfSettingsSuiteSetupTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/update/UpdateOfSettingsSuiteSetupTest.java index 04c6023b4..37c745834 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/update/UpdateOfSettingsSuiteSetupTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/settings/update/UpdateOfSettingsSuiteSetupTest.java @@ -24,7 +24,7 @@ public class UpdateOfSettingsSuiteSetupTest { @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) - public void test_createArgumentOnPosition_2and3_whichNotExists_shouldReturnSingleLineSuiteSetup( + public void test_createArgumentOnPosition_2and3_whichNotExists_shouldReturnTwoSuiteSetupsWithArgs( final FileFormat format) throws Exception { // prepare final String inFileName = convert("Input_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition", format); @@ -32,19 +32,23 @@ public void test_createArgumentOnPosition_2and3_whichNotExists_shouldReturnSingl format); final Path inputFile = DumperTestHelper.getINSTANCE().getFile(inFileName); final RobotFile modelFile = RobotModelTestProvider.getModelFile(inputFile, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser()); // test data prepare final SettingTable settingTable = modelFile.getSettingTable(); - final SuiteSetup suiteSetup = settingTable.getSuiteSetupsViews().get(0); - suiteSetup.setArgument(2, "arg3"); - suiteSetup.setArgument(3, ""); + final SuiteSetup suiteSetup1 = settingTable.getSuiteSetups().get(0); + final SuiteSetup suiteSetup2 = settingTable.getSuiteSetups().get(1); + suiteSetup2.setArgument(2, "arg3"); + suiteSetup2.setArgument(3, ""); // verify - assertThat(settingTable.getSuiteSetups()).hasSize(1); - final SuiteSetup suiteSetupCurrent = settingTable.getSuiteSetups().get(0); - assertThat(suiteSetupCurrent).isSameAs(suiteSetup); - assertThat(suiteSetupCurrent.getArguments()).hasSize(4); + assertThat(settingTable.getSuiteSetups()).hasSize(2); + final SuiteSetup suiteSetupCurrent1 = settingTable.getSuiteSetups().get(0); + final SuiteSetup suiteSetupCurrent2 = settingTable.getSuiteSetups().get(1); + assertThat(suiteSetupCurrent1).isSameAs(suiteSetup1); + assertThat(suiteSetupCurrent2).isSameAs(suiteSetup2); + assertThat(suiteSetupCurrent1.getArguments()).isEmpty(); + assertThat(suiteSetupCurrent2.getArguments()).hasSize(4); NewRobotFileTestHelper.assertNewModelTheSameAsInFile(outputFileName, modelFile); } @@ -56,7 +60,7 @@ public void test_emptyFile_updateSuiteSetup_withSetArgumentToEmptyValue(final Fi final String outputFileName = convert("Output_SuiteSetupWithKeywordAndTwoArgumentsOneToRemove", format); final Path inputFile = DumperTestHelper.getINSTANCE().getFile(inFileName); final RobotFile modelFile = RobotModelTestProvider.getModelFile(inputFile, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser()); // test data prepare final SettingTable settingTable = modelFile.getSettingTable(); @@ -75,7 +79,7 @@ public void test_emptyFile_updateSuiteSetup_andKeywordName(final FileFormat form final String outputFileName = convert("Output_KeywordSetNoOtherElements", format); final Path inputFile = DumperTestHelper.getINSTANCE().getFile(inFileName); final RobotFile modelFile = RobotModelTestProvider.getModelFile(inputFile, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser()); // test data prepare final SettingTable settingTable = modelFile.getSettingTable(); @@ -94,7 +98,7 @@ public void test_emptyFile_updateSuiteSetup_andCommentOnly(final FileFormat form final String outputFileName = convert("Output_CommentSetNoOtherElements", format); final Path inputFile = DumperTestHelper.getINSTANCE().getFile(inFileName); final RobotFile modelFile = RobotModelTestProvider.getModelFile(inputFile, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser()); // test data prepare final SettingTable settingTable = modelFile.getSettingTable(); @@ -123,7 +127,7 @@ public void test_emptyFile_updateSuiteSetup_withKeywordExists_andCommentOnly(fin final String outputFileName = convert("Output_KeywordExistsAndCommentSetNoOtherElements", format); final Path inputFile = DumperTestHelper.getINSTANCE().getFile(inFileName); final RobotFile modelFile = RobotModelTestProvider.getModelFile(inputFile, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser()); // test data prepare final SettingTable settingTable = modelFile.getSettingTable(); @@ -152,7 +156,7 @@ public void test_emptyFile_updateSuiteSetup_withKeywordExists_withArgToAdd_andCo final String outputFileName = convert("Ouput_KeywordArgumentInDifferentLine", format); final Path inputFile = DumperTestHelper.getINSTANCE().getFile(inFileName); final RobotFile modelFile = RobotModelTestProvider.getModelFile(inputFile, - RobotModelTestProvider.getParser("2.9")); + RobotModelTestProvider.getParser()); // test data prepare final SettingTable settingTable = modelFile.getSettingTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseDocumentationTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseDocumentationTest.java index 9a45087a8..efde14e0e 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseDocumentationTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseDocumentationTest.java @@ -19,13 +19,15 @@ public class CreationOfTestCaseDocumentationTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestCaseDocumentation_withName_andThreeLinesOfDocumentation( final FileFormat format) throws Exception { // prepare final String filePath = convert("TestDocumentationWithThreeLinesCreation", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -62,7 +64,7 @@ private void test_onlyTestCaseDoc_decIncluded(final String fileNameWithoutExt, f final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -96,7 +98,7 @@ private void test_testDoc_withCommentOnly(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -134,7 +136,7 @@ private void test_docOnlyWith3Words(final String fileNameWithoutExt, final Strin final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -172,7 +174,7 @@ private void test_testDoc_withDoc3Words_andComment(final String fileNameWithoutE final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableOneStepTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableOneStepTest.java index 7b5edc12a..636d7ba3e 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableOneStepTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableOneStepTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseExecutableOneStepTest extends ACreationOfExecutionRowTest { + private static final String ROBOT_VERSION = "3.0"; + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public IExecutableStepsHolder getExecutableWithName() { @@ -33,7 +35,7 @@ public IExecutableStepsHolder getExecutableWithoutName() { } private TestCase createModelWithOneTestCaseInside() { - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); modelFile.includeTestCaseTableSection(); final TestCaseTable testCaseTable = modelFile.getTestCaseTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableThreeStepsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableThreeStepsTest.java index b997c522e..aaf7ca2ab 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableThreeStepsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseExecutableThreeStepsTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseExecutableThreeStepsTest extends ACreationOfThreeExecutionRowsTest { + private static final String ROBOT_VERSION = "3.0"; + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public IExecutableStepsHolder getExecutableWithName() { @@ -33,7 +35,7 @@ public IExecutableStepsHolder getExecutableWithoutName() { } private TestCase createModelWithOneTestCaseInside() { - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); modelFile.includeTestCaseTableSection(); final TestCaseTable testCaseTable = modelFile.getTestCaseTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseSetupTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseSetupTest.java index 70baf5ec2..d30b48e6f 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseSetupTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseSetupTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseSetupTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestSetup_withoutTestName_andSetupDecOnly(final FileFormat format) @@ -35,7 +37,7 @@ private void test_setupDecOnly(final String fileNameWithoutExt, final String use throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -69,7 +71,7 @@ private void test_setupWithCommentOnly(final String fileNameWithoutExt, final St final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -107,7 +109,7 @@ private void test_setupWithExec(final String fileNameWithoutExt, final String us throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -143,7 +145,7 @@ private void test_setupWithExec_andComment(final String fileNameWithoutExt, fina final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -182,7 +184,7 @@ private void test_setupWithExec_and3Args(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -221,7 +223,7 @@ private void test_setupWithExec_and3Args_andComment(final String fileNameWithout final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTableHeaderTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTableHeaderTest.java index c23c7cafb..ba03a3c22 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTableHeaderTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTableHeaderTest.java @@ -16,12 +16,14 @@ public class CreationOfTestCaseTableHeaderTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestCaseHeaderOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("TestCasesHeaderOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -36,7 +38,7 @@ public void test_emptyFile_and_thanCreateTestCaseHeader_withTwoNamedColumns(fina throws Exception { // prepare final String fileName = convert("TestCasesHeaderWithColumns", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -58,7 +60,7 @@ public void test_emptyFile_and_thanCreateTestCaseHeader_withTwoCommentTokens(fin throws Exception { // prepare final String fileName = convert("TestCasesHeaderWithComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -80,7 +82,7 @@ public void test_emptyFile_and_thanCreateTestCaseHeader_withTwoNamedColumns_and_ final FileFormat format) throws Exception { // prepare final String fileName = convert("TestCasesHeaderWithColumnsAndComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTagsTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTagsTest.java index 5f7648d9a..b1d274d6b 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTagsTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTagsTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseTagsTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestCaseTags_withoutTestName_andTagsDecOnly(final FileFormat format) @@ -35,7 +37,7 @@ private void test_tagsDecOnly(final String fileNameWithoutExt, final String user throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -69,7 +71,7 @@ private void test_tagsDec_andComment(final String fileNameWithoutExt, final Stri final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -114,7 +116,7 @@ private void test_tags_withTagsAnd3Tags(final String fileNameWithoutExt, final S final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -152,7 +154,7 @@ private void test_tags_with3Tags_andComment(final String fileNameWithoutExt, fin final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTeardownTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTeardownTest.java index ed18c0c0a..cd120515f 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTeardownTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTeardownTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseTeardownTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestTeardown_withoutTestName_andTeardownDecOnly(final FileFormat format) @@ -35,7 +37,7 @@ private void test_teardownDecOnly(final String fileNameWithoutExt, final String final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -69,7 +71,7 @@ private void test_teardownWithCommentOnly(final String fileNameWithoutExt, final final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -107,7 +109,7 @@ private void test_teardownWithExec(final String fileNameWithoutExt, final String final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -143,7 +145,7 @@ private void test_teardownWithExec_andComment(final String fileNameWithoutExt, f final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -182,7 +184,7 @@ private void test_teardownWithExec_and3Args(final String fileNameWithoutExt, fin final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -221,7 +223,7 @@ private void test_teardownWithExec_and3Args_andComment(final String fileNameWith final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTemplateTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTemplateTest.java index ecdfa9d37..ccf8287ce 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTemplateTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTemplateTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseTemplateTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestCaseTemplate_withoutTestName_andTemplateDecOnly( @@ -35,7 +37,7 @@ private void test_templateDecOnly(final String fileNameWithoutExt, final String final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -69,7 +71,7 @@ private void test_template_withCommentOnly(final String fileNameWithoutExt, fina final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -107,7 +109,7 @@ private void test_template_withKeywordOnly(final String fileNameWithoutExt, fina final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -143,7 +145,7 @@ private void test_template_withKeyword_andComment(final String fileNameWithoutEx final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -182,7 +184,7 @@ private void test_template_withKeyword_and3ArgsUnwanted(final String fileNameWit final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -223,7 +225,7 @@ private void test_template_withKeyword_and3ArgsUnwanted_andComment(final String final String userTestName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTimeoutTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTimeoutTest.java index 872ceae5d..3cf574a16 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTimeoutTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfTestCaseTimeoutTest.java @@ -17,6 +17,8 @@ public class CreationOfTestCaseTimeoutTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateTestCaseTimeout_withoutKeywordName_andTimeoutDecOnly( @@ -35,7 +37,7 @@ private void test_timeoutDecOnly(final String fileNameWithoutExt, final String u final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -72,7 +74,7 @@ private void test_timeoutDec_withCommentOnly(final String fileNameWithoutExt, fi throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -113,7 +115,7 @@ private void test_timeoutDec_withComment_andValue(final String fileNameWithoutEx throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -152,7 +154,7 @@ private void test_timeoutDec_withComment_andValue_andComment(final String fileNa final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -193,7 +195,7 @@ private void test_timeoutDec_withComment_andValue_and3MsgArgs(final String fileN final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); @@ -236,7 +238,7 @@ private void test_timeoutDec_withComment_andValue_and3MsgArgs_andComment(final S final String userKeywordName, final FileFormat format) throws Exception { // prepare final String filePath = convert(fileNameWithoutExt, format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeTestCaseTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfThreeTestCaseExecutablesWithOneStepTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfThreeTestCaseExecutablesWithOneStepTest.java index 2ce4ac95c..cf2463800 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfThreeTestCaseExecutablesWithOneStepTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/testcases/creation/CreationOfThreeTestCaseExecutablesWithOneStepTest.java @@ -22,6 +22,8 @@ public class CreationOfThreeTestCaseExecutablesWithOneStepTest extends ACreationOfThreeExecUnitsTest { + private static final String ROBOT_VERSION = "3.0"; + @Override public List>> getExecutablesAllWithNames() { final List>> units = createModelWithOneTestCaseInside(); @@ -53,7 +55,7 @@ private List>> execUnits = new ArrayList<>( 0); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); modelFile.includeTestCaseTableSection(); final TestCaseTable keywordTable = modelFile.getTestCaseTable(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfDictionaryVariableTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfDictionaryVariableTest.java index c7e60a17b..3ba773bcf 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfDictionaryVariableTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfDictionaryVariableTest.java @@ -20,12 +20,14 @@ public class CreationOfDictionaryVariableTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateDictionaryVariable(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyDictionaryVariableDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -42,7 +44,7 @@ public void test_emptyFile_and_thanCreationDictionary_withThreeKeyValuePairs(fin throws Exception { // prepare final String fileName = convert("DictionaryVariableDeclarationWithThreeValuePairKeysOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -63,7 +65,7 @@ public void test_emptyFile_and_thanCreationDictionary_withThreeKeyValuePairs(fin public void test_emptyFile_and_thanCreationDictionary_withComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("DictionaryVariableDeclarationWithCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -91,7 +93,7 @@ public void test_emptyFile_and_thanCreationDictionary_withThreeKeyValuePair_andC throws Exception { // prepare final String fileName = convert("DictionaryVariableDeclarationWithCommentAndThreeKeyValuePairOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -122,7 +124,7 @@ public void test_emptyFile_and_thanCreationDictionary_withThreeKeyValuePair_andL final FileFormat format) throws Exception { // prepare final String fileName = convert("DictionaryVariableDeclarationWith2ValuesEmptyAndLastSet", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -144,7 +146,7 @@ public void test_emptyFile_and_thanCreationDictionary_withThreeKeyValuePair_andM final FileFormat format) throws Exception { // prepare final String fileName = convert("DictionaryVariableDeclarationWith1ValueEmptyNextSetAndLastEmpty", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfListVariableTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfListVariableTest.java index 0dad99db4..50bb8a85c 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfListVariableTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfListVariableTest.java @@ -19,12 +19,14 @@ public class CreationOfListVariableTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateDictionaryVariable(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyListVariableDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -40,7 +42,7 @@ public void test_emptyFile_and_thanCreateDictionaryVariable(final FileFormat for public void test_emptyFile_and_thanCreateDictionaryVariable_andComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("ListVariableDeclarationWithCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -59,7 +61,7 @@ public void test_emptyFile_and_thanCreateDictionaryVariable_andComment(final Fil public void test_emptyFile_and_thanCreateDictionaryVariable_andOneValue(final FileFormat format) throws Exception { // prepare final String fileName = convert("ListVariableDeclarationAndOneValueOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -79,7 +81,7 @@ public void test_emptyFile_and_thanCreateDictionaryVariable_andOneValue_andComme throws Exception { // prepare final String fileName = convert("ListVariableDeclarationAndOneValueAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -102,7 +104,7 @@ public void test_emptyFile_and_thanCreateDictionaryVariable_andThreeValues(final throws Exception { // prepare final String fileName = convert("ListVariableDeclarationAnd3ValueOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -124,7 +126,7 @@ public void test_emptyFile_and_thanCreateDictionaryVariable_andThreeValues_andCo throws Exception { // prepare final String fileName = convert("ListVariableDeclarationAnd3ValueAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -149,7 +151,7 @@ public void test_emptyFile_and_thanCreationList_withThreeValues_andLastOnlyHasVa throws Exception { // prepare final String fileName = convert("ListVariableDeclarationWith2ValuesEmptyAndLastSet", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -171,7 +173,7 @@ public void test_emptyFile_and_thanCreationList_withThreeValues_andMiddleHasValu throws Exception { // prepare final String fileName = convert("ListVariableDeclarationWith1ValueEmptyNextSetAndLastEmpty", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfScalarVariableTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfScalarVariableTest.java index 733d5690b..2640e0f05 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfScalarVariableTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfScalarVariableTest.java @@ -19,12 +19,14 @@ public class CreationOfScalarVariableTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateScalarVariable(final FileFormat format) throws Exception { // prepare final String fileName = convert("EmptyScalarVariableDeclarationOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -40,7 +42,7 @@ public void test_emptyFile_and_thanCreateScalarVariable(final FileFormat format) public void test_emptyFile_and_thanCreateScalarVariable_andComment(final FileFormat format) throws Exception { // prepare final String fileName = convert("ScalarVariableDeclarationWithCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -59,7 +61,7 @@ public void test_emptyFile_and_thanCreateScalarVariable_andComment(final FileFor public void test_emptyFile_and_thanCreateScalarVariable_andOneValue(final FileFormat format) throws Exception { // prepare final String fileName = convert("ScalarVariableDeclarationAndOneValueOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -79,7 +81,7 @@ public void test_emptyFile_and_thanCreateScalarVariable_andOneValue_andComment(f throws Exception { // prepare final String fileName = convert("ScalarVariableDeclarationAndOneValueAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -101,7 +103,7 @@ public void test_emptyFile_and_thanCreateScalarVariable_andOneValue_andComment(f public void test_emptyFile_and_thanCreateScalarVariable_andThreeValues(final FileFormat format) throws Exception { // prepare final String fileName = convert("ScalarVariableDeclarationAnd3ValueOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -123,7 +125,7 @@ public void test_emptyFile_and_thanCreateScalarVariable_andThreeValues_andCommen throws Exception { // prepare final String fileName = convert("ScalarVariableDeclarationAnd3ValueAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -148,7 +150,7 @@ public void test_emptyFile_and_thanCreateDictionaryVariable_andEmptyValue_andCom throws Exception { // prepare final String fileName = convert("ScalarVariableDeclarationAndEmptyValueAndCommentOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfVariableTableHeaderTest.java b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfVariableTableHeaderTest.java index 4db403793..f447a2903 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfVariableTableHeaderTest.java +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/java/org/rf/ide/core/testdata/text/write/tables/variables/creation/CreationOfVariableTableHeaderTest.java @@ -16,12 +16,14 @@ public class CreationOfVariableTableHeaderTest { + private static final String ROBOT_VERSION = "3.0"; + @ParameterizedTest @EnumSource(value = FileFormat.class, names = { "TXT_OR_ROBOT", "TSV" }) public void test_emptyFile_and_thanCreateVariableHeaderOnly(final FileFormat format) throws Exception { // prepare final String fileName = convert("VariablesHeaderOnly", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -36,7 +38,7 @@ public void test_emptyFile_and_thanCreateVariableHeader_withTwoNamedColumns(fina throws Exception { // prepare final String fileName = convert("VariablesHeaderWithColumns", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -58,7 +60,7 @@ public void test_emptyFile_and_thanCreateVariableHeader_withTwoCommentTokens(fin throws Exception { // prepare final String fileName = convert("VariablesHeaderWithComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); @@ -80,7 +82,7 @@ public void test_emptyFile_and_thanCreateVariableHeader_withTwoNamedColumns_and_ final FileFormat format) throws Exception { // prepare final String fileName = convert("VariablesHeaderWithColumnsAndComments", format); - final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify("2.9"); + final RobotFile modelFile = NewRobotFileTestHelper.getModelFileToModify(ROBOT_VERSION); // test data prepare modelFile.includeVariableTableSection(); diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.robot b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.robot index de114acdd..a218000ee 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.robot +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.robot @@ -1,2 +1,3 @@ *** Settings *** -Suite Setup key key_arg1 \ arg3 \ No newline at end of file +Suite Setup key +Suite Setup key_arg1 \ \ arg3 \ No newline at end of file diff --git a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.tsv b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.tsv index de114acdd..a218000ee 100644 --- a/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.tsv +++ b/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/test/resources/org/rf/ide/core/testdata/text/write/settings/suiteSetup/update/Output_TwoSuiteSetups_commonViewUpdatedByArgInNotExistingPosition.tsv @@ -1,2 +1,3 @@ *** Settings *** -Suite Setup key key_arg1 \ arg3 \ No newline at end of file +Suite Setup key +Suite Setup key_arg1 \ \ arg3 \ No newline at end of file