diff --git a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/AbstractCheckTestCase.java b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/AbstractCheckTestCase.java index 21ac794f36..7ed4780ee6 100644 --- a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/AbstractCheckTestCase.java +++ b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/AbstractCheckTestCase.java @@ -73,7 +73,7 @@ public abstract class AbstractCheckTestCase { private Provider resourceSetProvider; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { getInjector().injectMembers(this); } diff --git a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugAig1314.java b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugAig1314.java index be1c683a8c..31394387ee 100644 --- a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugAig1314.java +++ b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugAig1314.java @@ -42,7 +42,7 @@ @ExtendWith(InjectionExtension.class) @InjectWith(CheckInjectorProvider.class) @SuppressWarnings("nls") -public class BugAig1314 { +class BugAig1314 { /** Constructor of super class is protected... */ private static class TestScope extends CatalogFromExtensionPointScope { diff --git a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugDsl27.java b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugDsl27.java index dd1ea2081d..3d5e7973ce 100644 --- a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugDsl27.java +++ b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugDsl27.java @@ -27,7 +27,7 @@ @InjectWith(CheckInjectorProvider.class) @ExtendWith(InjectionExtension.class) @SuppressWarnings("nls") -public class BugDsl27 extends AbstractCheckGenerationTestCase { +class BugDsl27 extends AbstractCheckGenerationTestCase { /** * Tests that our test source compiles fine. diff --git a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/test/core/CheckCoreTestSuite.java b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/test/core/CheckCoreTestSuite.java index 91ee1b81ec..97b4a29eb6 100644 --- a/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/test/core/CheckCoreTestSuite.java +++ b/com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/test/core/CheckCoreTestSuite.java @@ -10,37 +10,18 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.test.core; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.check.core.generator.IssueCodeValueTest; -import com.avaloq.tools.ddk.check.core.test.BasicModelTest; -import com.avaloq.tools.ddk.check.core.test.BugAig1314; -import com.avaloq.tools.ddk.check.core.test.BugAig830; -import com.avaloq.tools.ddk.check.core.test.BugDsl27; -import com.avaloq.tools.ddk.check.core.test.CheckScopingTest; -import com.avaloq.tools.ddk.check.core.test.IssueCodeToLabelMapGenerationTest; -import com.avaloq.tools.ddk.check.core.test.ProjectBasedTests; -import com.avaloq.tools.ddk.check.formatting.CheckFormattingTest; /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - IssueCodeValueTest.class, - BasicModelTest.class, - BugAig830.class, - CheckScopingTest.class, - IssueCodeToLabelMapGenerationTest.class, - ProjectBasedTests.class, - BugAig1314.class, - BugDsl27.class, - CheckFormattingTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.check.core.test" }) -public class CheckCoreTestSuite { +class CheckCoreTestSuite { } diff --git a/com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/resource/CheckBatchLinkableResource.java b/com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/resource/CheckBatchLinkableResource.java index 7e44dad8ba..2693425345 100644 --- a/com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/resource/CheckBatchLinkableResource.java +++ b/com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/resource/CheckBatchLinkableResource.java @@ -49,7 +49,6 @@ public InputStream createInputStream(final URI uri, final Map options) thr }; } - @SuppressWarnings("restriction") @Override public void load(final Map options) throws IOException { modelLocation = (IModelLocation) options.get(MAYBE_LOCATION_DATA); diff --git a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/context/CheckContextTest.java b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/context/CheckContextTest.java index 6fe8e08773..5a427fc88b 100644 --- a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/context/CheckContextTest.java +++ b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/context/CheckContextTest.java @@ -21,7 +21,7 @@ * Provides some tests of the reflective {@link AbstractCheckContext} framework. */ @SuppressWarnings("nls") -public class CheckContextTest { +class CheckContextTest { public static final String ENABLED_ISSUE_CODE = "Enabled.Issue.Code"; public static final String DISABLED_ISSUE_CODE = "Disabled.Issue.Code"; diff --git a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/registry/CheckExtensionPointTests.java b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/registry/CheckExtensionPointTests.java index be407539bf..109474d0ab 100644 --- a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/registry/CheckExtensionPointTests.java +++ b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/registry/CheckExtensionPointTests.java @@ -30,7 +30,7 @@ * Provides some test cases for the Check extension point. */ @SuppressWarnings("nls") -public class CheckExtensionPointTests { +class CheckExtensionPointTests { private static final String DUMMY_EXTENSION_ID = "com.avaloq.tools.ddk.check.runtime.core.test"; private static final String CHECK_EXTENSION_ID = "com.avaloq.tools.ddk.check.runtime.core"; diff --git a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/validation/CheckValidatorTest.java b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/validation/CheckValidatorTest.java index bb60b5682e..a8e64e841b 100644 --- a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/validation/CheckValidatorTest.java +++ b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/core/validation/CheckValidatorTest.java @@ -24,7 +24,7 @@ * Performs some basic validation tests on the {@link AbstractCheckValidator}. */ @SuppressWarnings("nls") -public class CheckValidatorTest extends AbstractCheckValidator { +class CheckValidatorTest extends AbstractCheckValidator { /** * Represents the dummy language which is also registered in the plugin.xml. */ diff --git a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/label/CheckRuleLabelProviderTest.java b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/label/CheckRuleLabelProviderTest.java index 35c30852bd..9247eea27b 100644 --- a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/label/CheckRuleLabelProviderTest.java +++ b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/label/CheckRuleLabelProviderTest.java @@ -40,7 +40,7 @@ * Unit test for {@link DefaultCheckRuleLabelProvider}. */ @SuppressWarnings("nls") -public class CheckRuleLabelProviderTest { +class CheckRuleLabelProviderTest { // Test data private static final int NUM_VALIDATORS = 3; diff --git a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/test/core/CheckRuntimeTestSuite.java b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/test/core/CheckRuntimeTestSuite.java index 610aadb756..62c204fda7 100644 --- a/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/test/core/CheckRuntimeTestSuite.java +++ b/com.avaloq.tools.ddk.check.runtime.core.test/src/com/avaloq/tools/ddk/check/runtime/test/core/CheckRuntimeTestSuite.java @@ -10,27 +10,22 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.runtime.test.core; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.check.runtime.context.CheckContextTest; -import com.avaloq.tools.ddk.check.runtime.core.registry.CheckExtensionPointTests; -import com.avaloq.tools.ddk.check.runtime.core.validation.CheckValidatorTest; -import com.avaloq.tools.ddk.check.runtime.label.CheckRuleLabelProviderTest; - /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - CheckContextTest.class, - CheckExtensionPointTests.class, - CheckValidatorTest.class, - CheckRuleLabelProviderTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.check.runtime.context", + "com.avaloq.tools.ddk.check.runtime.core.registry", + "com.avaloq.tools.ddk.check.runtime.core.validation", + "com.avaloq.tools.ddk.check.runtime.label" }) -public class CheckRuntimeTestSuite { +@IncludeClassNamePatterns(".*Test.*") +class CheckRuntimeTestSuite { } diff --git a/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckExecutionEnvironmentTestSuite.java b/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckExecutionEnvironmentTestSuite.java index a218c4de52..f2c7134bea 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckExecutionEnvironmentTestSuite.java +++ b/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckExecutionEnvironmentTestSuite.java @@ -10,23 +10,18 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.test.runtime.tests; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.check.test.runtime.CheckConfigurationIsAppliedTest; -import com.avaloq.tools.ddk.check.test.runtime.CheckExecutionEnvironmentProjectTest; /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - CheckConfigurationIsAppliedTest.class, - CheckExecutionEnvironmentProjectTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.check.test.runtime" }) -public class CheckExecutionEnvironmentTestSuite { +class CheckExecutionEnvironmentTestSuite { } diff --git a/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckLibraryChecksTestSuite.java b/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckLibraryChecksTestSuite.java index abedf3c564..312daec5ba 100644 --- a/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckLibraryChecksTestSuite.java +++ b/com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckLibraryChecksTestSuite.java @@ -11,21 +11,18 @@ package com.avaloq.tools.ddk.check.test.runtime.tests; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.check.test.runtime.label.IssueLabelTest; /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - IssueLabelTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.check.test.runtime.label" }) -public class CheckLibraryChecksTestSuite { +class CheckLibraryChecksTestSuite { } diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckCatalogWizardTest.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckCatalogWizardTest.java index 9afa389fdc..dc8cff94d3 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckCatalogWizardTest.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckCatalogWizardTest.java @@ -58,7 +58,7 @@ @ExtendWith(InjectionExtension.class) @SuppressWarnings("nls") @TestInstance(Lifecycle.PER_CLASS) -public class CheckCatalogWizardTest { +class CheckCatalogWizardTest { /** This is the name of the catalog wizard. It's the name SWTBot uses to look up the wizard. */ private static final String CHECK_CATALOG = "Check Catalog"; @@ -121,7 +121,7 @@ protected void execute(final IProgressMonitor monitor) throws CoreException, Inv *

*/ @BeforeEach - public void setUp() { + void setUp() { wizard = new SwtWizardBot(); project = createProject(); for (Grammar g : new CheckResourceUtil().getGrammars()) { // make sure all grammars accessible for combo field. @@ -141,7 +141,7 @@ private void initializeWizardBot() { * Test if the package field contains the selected package. */ @Test - public void testPackageSelected() { + void testPackageSelected() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); initializeWizardBot(); // because the selected item is a package initially, this package is shown in the field. @@ -152,7 +152,7 @@ public void testPackageSelected() { * Test if catalog wizard is enabled if a project folder is selected. */ @Test - public void testCheckCatalogWizardIsEnabled() { + void testCheckCatalogWizardIsEnabled() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); // open the check catalog wizard after having selected the project source folder. // that way, the wizard page should be enabled. @@ -168,7 +168,7 @@ public void testCheckCatalogWizardIsEnabled() { * Test if the package field is empty, if the selected item is no package. */ @Test - public void testInitiallyNoPackageSelected() { + void testInitiallyNoPackageSelected() { selectProjectFolder(wizard, SRC_FOLDER); initializeWizardBot(); @@ -180,7 +180,7 @@ public void testInitiallyNoPackageSelected() { * Test if the next and finish button are disabled if the package name is invalid. */ @Test - public void testPackageNameInvalid() { + void testPackageNameInvalid() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); // open the check catalog wizard after having selected the project source folder. initializeWizardBot(); @@ -196,7 +196,7 @@ public void testPackageNameInvalid() { * Test if the finish button is enabled if the package name is valid. */ @Test - public void testPackageNameValid() { + void testPackageNameValid() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); // open the check catalog wizard after having selected the project source folder. initializeWizardBot(); @@ -209,7 +209,7 @@ public void testPackageNameValid() { * Test if the next and finish button are disabled if the catalog name is invalid. */ @Test - public void testCatalogNameInvalid() { + void testCatalogNameInvalid() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); // open the check catalog wizard after having selected the project source folder. initializeWizardBot(); @@ -223,7 +223,7 @@ public void testCatalogNameInvalid() { * Tests that discouraged catalog names are accepted. */ @Test - public void testCatalogNameDiscouraged() { + void testCatalogNameDiscouraged() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); initializeWizardBot(); @@ -236,7 +236,7 @@ public void testCatalogNameDiscouraged() { * Tests valid catalog names. */ @Test - public void testCatalogName() { + void testCatalogName() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); initializeWizardBot(); @@ -263,7 +263,7 @@ public void testInitiallyNoGrammarSelected() { * if project doesn't exist. */ @AfterEach - public void tearDown() throws CoreException { + void tearDown() throws CoreException { wizard.closeWizard(); project.delete(true, new NullProgressMonitor()); } diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckProjectWizardTest.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckProjectWizardTest.java index 4ee768c4ae..f8a77dd80d 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckProjectWizardTest.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckProjectWizardTest.java @@ -35,7 +35,7 @@ @InjectWith(CheckWizardUiTestInjectorProvider.class) @ExtendWith(InjectionExtension.class) @SuppressWarnings("nls") -public class CheckProjectWizardTest { +class CheckProjectWizardTest { /** This is the name of the project wizard. It's the name SWTBot uses to look up the wizard. */ private static final String CHECK_PROJECT_WIZARD_NAME = "Check Project"; @@ -49,7 +49,7 @@ public class CheckProjectWizardTest { * Start again the Check project wizard before every test. */ @BeforeEach - public void setUp() { + void setUp() { wizard = new SwtWizardBot(); wizard.openNewWizard(CHECK_PROJECT_WIZARD_NAME); } @@ -58,7 +58,7 @@ public void setUp() { * Check if the project wizard is available. */ @Test - public void testCheckProjectWizardIsAvailable() { + void testCheckProjectWizardIsAvailable() { assertNotNull(wizard, "the project wizard was found"); CheckWizardTestUtil.assertButtonsEnabled(false, true, false, wizard); } @@ -67,7 +67,7 @@ public void testCheckProjectWizardIsAvailable() { * Test if the buttons 'next', 'back' and 'finish' are correctly enabled/disabled. */ @Test - public void testProjectNameInvalid() { + void testProjectNameInvalid() { CheckWizardTestUtil.projectName(wizard, "", CheckWizardTestUtil.NEXT_DISABLED); CheckWizardTestUtil.projectName(wizard, ".project.name", CheckWizardTestUtil.NEXT_DISABLED); CheckWizardTestUtil.projectName(wizard, "Project.name", CheckWizardTestUtil.NEXT_DISABLED); @@ -88,7 +88,7 @@ public void testFinishButtonDisabledInProjectPage() { * Test if the buttons 'next', 'back' and 'finish' are correctly enabled/disabled. */ @Test - public void testProjectNameValid() { + void testProjectNameValid() { CheckWizardTestUtil.projectName(wizard, "project.name", CheckWizardTestUtil.NEXT_ENABLED); CheckWizardTestUtil.projectName(wizard, "projectname", CheckWizardTestUtil.NEXT_ENABLED); } @@ -97,7 +97,7 @@ public void testProjectNameValid() { * Test if the buttons 'next', 'back' and 'finish' are correctly enabled/disabled. */ @Test - public void fieldValuesAfterPageChange() { + void fieldValuesAfterPageChange() { wizard.writeToTextField(Messages.PROJECT_NAME_LABEL, CORRECT_PROJECT_NAME); wizard.changeToPreviousPage(); wizard.changeToNextPage(); @@ -122,7 +122,7 @@ public void testNextButtonChangesPage() { * Close the wizard after every test. */ @AfterEach - public void tearDown() { + void tearDown() { wizard.closeWizard(); } diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckUiTestSuite.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckUiTestSuite.java index de6a8964e6..f66f5908b0 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckUiTestSuite.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/CheckUiTestSuite.java @@ -10,14 +10,9 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.ui.test; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.check.ui.test.builder.CheckContextsExtensionTest; -import com.avaloq.tools.ddk.check.ui.test.builder.CheckMarkerHelpExtensionTest; -import com.avaloq.tools.ddk.check.ui.test.builder.CheckTocExtensionTest; -import com.avaloq.tools.ddk.check.ui.test.contentassist.BugAig931Test; -import com.avaloq.tools.ddk.check.ui.test.quickfix.CheckQuickfixTest; /** @@ -25,15 +20,11 @@ */ // @Format-Off @Suite -@SelectClasses({ - CheckQuickfixTest.class, - CheckProjectWizardTest.class, - CheckCatalogWizardTest.class, - CheckMarkerHelpExtensionTest.class, - CheckContextsExtensionTest.class, - CheckTocExtensionTest.class, - BugAig931Test.class +@SelectPackages({ + "com.avaloq.tools.ddk.check.ui.test.builder", + "com.avaloq.tools.ddk.check.ui.test.contentassist", + "com.avaloq.tools.ddk.check.ui.test.quickfix" }) // @Format-On -public class CheckUiTestSuite { +class CheckUiTestSuite { } diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckContextsExtensionTest.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckContextsExtensionTest.java index 7320a12388..35322cb483 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckContextsExtensionTest.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckContextsExtensionTest.java @@ -44,7 +44,7 @@ @SuppressWarnings({"restriction", "nls"}) @InjectWith(CheckWizardUiTestInjectorProvider.class) @ExtendWith(InjectionExtension.class) -public class CheckContextsExtensionTest { +class CheckContextsExtensionTest { private static final String CATALOG_WITH_FIRST_CHECK_LIVE = "package com.test catalog c for grammar g { live error \"First Check\"{ for g { issue }}}"; @@ -59,7 +59,7 @@ public class CheckContextsExtensionTest { private IWorkspace workspace; @BeforeEach - public void setUp() { + void setUp() { try { catalog = parser.parse(CATALOG_WITH_FIRST_CHECK_LIVE); } catch (Exception e) { @@ -76,7 +76,7 @@ public void setUp() { * core exception */ @Test - public void testCreateExtension() throws CoreException { + void testCreateExtension() throws CoreException { IPluginExtension extension = contextsUtil.addExtensionToPluginBase(pluginModel, catalog, ExtensionType.CONTEXTS, null); // Test if the extension has been created. assertEquals(CheckContextsExtensionHelper.CONTEXTS_EXTENSION_POINT_ID, extension.getPoint(), "Contexts extension has been created."); @@ -92,7 +92,7 @@ public void testCreateExtension() throws CoreException { * the core exception */ @Test - public void testIsExtensionUpdateRequiredTrue() throws CoreException { + void testIsExtensionUpdateRequiredTrue() throws CoreException { IPluginExtension extension = createErroneousExtension(); Iterable elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class); assertTrue(contextsUtil.isExtensionUpdateRequired(catalog, extension, elements), "Extension update is required"); @@ -105,7 +105,7 @@ public void testIsExtensionUpdateRequiredTrue() throws CoreException { * the core exception */ @Test - public void testIsExtensionUpdateRequiredFalse() throws CoreException { + void testIsExtensionUpdateRequiredFalse() throws CoreException { IPluginExtension extension = contextsUtil.addExtensionToPluginBase(pluginModel, catalog, ExtensionType.CONTEXTS, null); Iterable elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class); assertFalse(contextsUtil.isExtensionUpdateRequired(catalog, extension, elements), "No extension update is required "); diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckMarkerHelpExtensionTest.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckMarkerHelpExtensionTest.java index 7ca8b94d45..69bf575146 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckMarkerHelpExtensionTest.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckMarkerHelpExtensionTest.java @@ -49,7 +49,7 @@ @SuppressWarnings({"restriction", "PMD.SignatureDeclareThrowsException", "nls"}) @InjectWith(CheckWizardUiTestInjectorProvider.class) @ExtendWith(InjectionExtension.class) -public class CheckMarkerHelpExtensionTest { +class CheckMarkerHelpExtensionTest { private static final String SECONDCHECK_CONTEXTID = "null.c_secondcheck"; private static final String FIRSTCHECK_CONTEXID = "null.c_firstcheck"; @@ -79,7 +79,7 @@ public class CheckMarkerHelpExtensionTest { * the exception */ @Test - public void testCreateExtension() throws Exception { + void testCreateExtension() throws Exception { IPluginExtension extension = createMarkerHelpExtension(parser.parse(CATALOG_WITH_FIRST_CHECK_LIVE)); // Test if the extension has been created. @@ -99,7 +99,7 @@ public void testCreateExtension() throws Exception { * the exception */ @Test - public void testAddElement() throws Exception { + void testAddElement() throws Exception { final CheckCatalog catalogWithOneCheck = parser.parse(CATALOG_WITH_FIRST_CHECK_LIVE); IPluginExtension extension = createMarkerHelpExtension(catalogWithOneCheck); @@ -124,7 +124,7 @@ public void testAddElement() throws Exception { * the exception */ @Test - public void testRemoveElement() throws Exception { + void testRemoveElement() throws Exception { final CheckCatalog catalogWithTwoChecks = parser.parse(CATALOG_WITH_TWO_CHECKS); IPluginExtension extension = createMarkerHelpExtension(catalogWithTwoChecks); @@ -144,7 +144,7 @@ public void testRemoveElement() throws Exception { * the exception */ @Test - public void testMarkerTypeUpdate() throws Exception { + void testMarkerTypeUpdate() throws Exception { IPluginExtension extension = createMarkerHelpExtension(parser.parse(CATALOG_WITH_FIRST_CHECK_LIVE)); assertEquals(MARKERTYPE_FAST, ((IPluginElement) extension.getChildren()[0]).getAttribute(CheckMarkerHelpExtensionHelper.MARKERTYPE_ATTRIBUTE_TAG).getValue(), "Before update: Markertype is fast."); @@ -165,7 +165,7 @@ public void testMarkerTypeUpdate() throws Exception { * the exception */ @Test - public void testCheckHasTwoIssueCodes() throws Exception { + void testCheckHasTwoIssueCodes() throws Exception { IPluginExtension extension = createMarkerHelpExtension(parser.parse(CATALOG_WITH_FIRST_CHECK_LIVE)); CheckCatalog twoIssueCodes = parser.parse(CATALOG_CHECK_HAS_TWO_ISSUECODES); diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckTocExtensionTest.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckTocExtensionTest.java index 8a865abb13..259b62a70b 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckTocExtensionTest.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/builder/CheckTocExtensionTest.java @@ -45,7 +45,7 @@ @SuppressWarnings({"restriction", "PMD.SignatureDeclareThrowsException", "nls"}) @InjectWith(CheckWizardUiTestInjectorProvider.class) @ExtendWith(InjectionExtension.class) -public class CheckTocExtensionTest { +class CheckTocExtensionTest { @Inject private ParseHelper parser; @@ -62,7 +62,7 @@ public class CheckTocExtensionTest { private IPluginModelBase pluginModel; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { catalog = parser.parse(CATALOG_WITH_FIRST_CHECK_LIVE); IFile pluginxml = workspace.getRoot().getFile(new Path("/test/plugin.xml")); pluginModel = new WorkspacePluginModel(pluginxml, false); @@ -76,7 +76,7 @@ public void setUp() throws Exception { * the core exception */ @Test - public void testCreateExtension() throws CoreException { + void testCreateExtension() throws CoreException { IPluginExtension extension = tocUtil.addExtensionToPluginBase(pluginModel, catalog, ExtensionType.CONTEXTS, null); assertEquals(CheckTocExtensionHelper.TOC_EXTENSION_POINT_ID, extension.getPoint(), "Toc extension has been created"); assertEquals(tocUtil.getExtensionPointName(catalog), extension.getName(), "Toc extension name is correct"); @@ -91,7 +91,7 @@ public void testCreateExtension() throws CoreException { * the core exception */ @Test - public void testIsExtensionUpdateRequiredTrue() throws CoreException { + void testIsExtensionUpdateRequiredTrue() throws CoreException { IPluginExtension extension = createErroneousTocExtension(); Iterable elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class); @@ -123,7 +123,7 @@ private IPluginExtension createErroneousTocExtension() throws CoreException { * the core exception */ @Test - public void testUpdateTocExtension() throws CoreException { + void testUpdateTocExtension() throws CoreException { IPluginExtension extension = createErroneousTocExtension(); assertNotSame("File location is not as expected", CheckTocExtensionHelper.TOC_FILE_NAME, ((IPluginElement) extension.getChildren()[0]).getAttribute("file").getValue()); tocUtil.updateExtension(catalog, extension); @@ -137,7 +137,7 @@ public void testUpdateTocExtension() throws CoreException { * the core exception */ @Test - public void testIsExtensionUpdateRequiredFalse() throws CoreException { + void testIsExtensionUpdateRequiredFalse() throws CoreException { IPluginExtension extension = tocUtil.addExtensionToPluginBase(pluginModel, catalog, ExtensionType.CONTEXTS, null); Iterable elements = Iterables.filter(Lists.newArrayList(extension.getChildren()), IPluginElement.class); assertFalse(tocUtil.isExtensionUpdateRequired(catalog, extension, elements), "No toc extension update is required"); diff --git a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/contentassist/BugAig931Test.java b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/contentassist/BugAig931Test.java index 459c7a8e93..82cc187657 100644 --- a/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/contentassist/BugAig931Test.java +++ b/com.avaloq.tools.ddk.check.ui.test/src/com/avaloq/tools/ddk/check/ui/test/contentassist/BugAig931Test.java @@ -33,7 +33,7 @@ * Tests content assist in Check models. */ @SuppressWarnings({"PMD.SignatureDeclareThrowsException", "PMD.AvoidFinalLocalVariable", "nls"}) -public class BugAig931Test extends AbstractCheckContentAssistBugTest implements IJavaProjectProvider { +class BugAig931Test extends AbstractCheckContentAssistBugTest implements IJavaProjectProvider { /** * Verifies that given completions exist. @@ -63,11 +63,10 @@ public String apply(final ICompletionProposal input) { * the exception */ @Test - public void testBugAig931() throws Exception { + void testBugAig931() throws Exception { final String partialModel = "package p catalog T for grammar com.avaloq.tools.ddk.check.Check { error \"X\" for "; final String[] expectedContextTypeProposals = {"EObject - org.eclipse.emf.ecore", "JvmType - org.eclipse.xtext.common.types"}; new UIJob("compute completion proposals") { - @SuppressWarnings("restriction") @Override public IStatus runInUIThread(final IProgressMonitor monitor) { try { diff --git a/com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/CheckContextsGenerator.java b/com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/CheckContextsGenerator.java index e68a2ed1fb..ff23bcfca0 100644 --- a/com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/CheckContextsGenerator.java +++ b/com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/CheckContextsGenerator.java @@ -172,7 +172,6 @@ private CtxHelpContext createContextForCheck(final CtxHelpDocumentFactory factor * @throws CoreException * the core exception */ - @SuppressWarnings("unchecked") public void removeContexts(final Delta delta) throws CoreException { final IProject project = RuntimeProjectUtil.getProject(delta.getUri(), mapper); if (project != null) { diff --git a/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/test/CheckCfgTestSuite.java b/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/test/CheckCfgTestSuite.java index 17b83cf1f6..5a07a895fc 100644 --- a/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/test/CheckCfgTestSuite.java +++ b/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/test/CheckCfgTestSuite.java @@ -10,32 +10,22 @@ *******************************************************************************/ package com.avaloq.tools.ddk.checkcfg.test; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.checkcfg.contentassist.CheckCfgContentAssistTest; -import com.avaloq.tools.ddk.checkcfg.scoping.CheckCfgScopeProviderTest; -import com.avaloq.tools.ddk.checkcfg.syntax.CheckCfgSyntaxTest; -import com.avaloq.tools.ddk.checkcfg.validation.CheckCfgConfiguredParameterValidationsTest; -import com.avaloq.tools.ddk.checkcfg.validation.CheckCfgTest; -import com.avaloq.tools.ddk.checkcfg.validation.CheckCfgValidationTest; - /** * Empty class serving only as holder for JUnit5 annotations. */ @Suite -@SelectClasses({ -// @Format-Off - CheckCfgConfiguredParameterValidationsTest.class, - CheckCfgContentAssistTest.class, - CheckCfgScopeProviderTest.class, - CheckCfgSyntaxTest.class, - CheckCfgTest.class, - CheckCfgValidationTest.class -// @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.checkcfg.contentassist", + "com.avaloq.tools.ddk.checkcfg.scoping", + "com.avaloq.tools.ddk.checkcfg.syntax", + "com.avaloq.tools.ddk.checkcfg.validation" }) - -public class CheckCfgTestSuite { +@IncludeClassNamePatterns(".*Test.*") +class CheckCfgTestSuite { } diff --git a/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/validation/CheckCfgValidationTest.java b/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/validation/CheckCfgValidationTest.java index e78117de6b..f0e109700e 100644 --- a/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/validation/CheckCfgValidationTest.java +++ b/com.avaloq.tools.ddk.checkcfg.core.test/src/com/avaloq/tools/ddk/checkcfg/validation/CheckCfgValidationTest.java @@ -29,7 +29,7 @@ */ @InjectWith(CheckCfgUiInjectorProvider.class) @ExtendWith(InjectionExtension.class) -public class CheckCfgValidationTest { +class CheckCfgValidationTest { @Inject private ValidationTestHelper helper; @@ -50,7 +50,7 @@ public class CheckCfgValidationTest { * if a problem occurred parsing the test model */ @Test - public void testDisabledCheckIsNotConfigured() throws Exception { // NOPMD + void testDisabledCheckIsNotConfigured() throws Exception { // NOPMD CheckConfiguration model = parser.parse(modelUtil.basicModelWithDisabledTest() + " (val = 0)"); //$NON-NLS-1$ helper.assertWarning(model, CheckcfgPackage.Literals.CONFIGURED_CHECK, IssueCodes.DISABLED_CHECK_NOT_CONFIGURED); } diff --git a/com.avaloq.tools.ddk.checkcfg.ui.test/src/com/avaloq/tools/ddk/checkcfg/ui/test/CheckCfgUiTestSuite.java b/com.avaloq.tools.ddk.checkcfg.ui.test/src/com/avaloq/tools/ddk/checkcfg/ui/test/CheckCfgUiTestSuite.java index 60866c7ab5..afc0009f1f 100644 --- a/com.avaloq.tools.ddk.checkcfg.ui.test/src/com/avaloq/tools/ddk/checkcfg/ui/test/CheckCfgUiTestSuite.java +++ b/com.avaloq.tools.ddk.checkcfg.ui.test/src/com/avaloq/tools/ddk/checkcfg/ui/test/CheckCfgUiTestSuite.java @@ -15,5 +15,5 @@ */ // @Format-Off // @Format-On -public class CheckCfgUiTestSuite { +class CheckCfgUiTestSuite { } diff --git a/com.avaloq.tools.ddk.sample.helloworld.ui.test/src/com/avaloq/tools/ddk/sample/helloworld/test/HelloWorldSampleTestSuite.java b/com.avaloq.tools.ddk.sample.helloworld.ui.test/src/com/avaloq/tools/ddk/sample/helloworld/test/HelloWorldSampleTestSuite.java index 45a1fa6074..d97a8ba689 100644 --- a/com.avaloq.tools.ddk.sample.helloworld.ui.test/src/com/avaloq/tools/ddk/sample/helloworld/test/HelloWorldSampleTestSuite.java +++ b/com.avaloq.tools.ddk.sample.helloworld.ui.test/src/com/avaloq/tools/ddk/sample/helloworld/test/HelloWorldSampleTestSuite.java @@ -11,26 +11,20 @@ package com.avaloq.tools.ddk.sample.helloworld.test; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.sample.helloworld.check.CheckConfigurationIsAppliedTest; -import com.avaloq.tools.ddk.sample.helloworld.check.CheckExecutionEnvironmentProjectTest; -import com.avaloq.tools.ddk.sample.helloworld.label.IssueLabelTest; - /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - CheckConfigurationIsAppliedTest.class, - CheckExecutionEnvironmentProjectTest.class, - IssueLabelTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.sample.helloworld.check", + "com.avaloq.tools.ddk.sample.helloworld.label" }) - -public class HelloWorldSampleTestSuite { +@IncludeClassNamePatterns(".*Test.*") +class HelloWorldSampleTestSuite { } diff --git a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/junit/runners/ClassRunner.java b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/junit/runners/ClassRunner.java index 60074e5ac4..fabcf58c8f 100644 --- a/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/junit/runners/ClassRunner.java +++ b/com.avaloq.tools.ddk.test.core/src/com/avaloq/tools/ddk/test/core/junit/runners/ClassRunner.java @@ -100,7 +100,6 @@ public class ClassRunner extends BlockJUnit4ClassRunner { public static final String PROPERTY_UNSTABLE_FAIL = "com.avaloq.test.unstablefail"; //$NON-NLS-1$ /** Class-wide logger. */ private static final Logger LOGGER = LogManager.getLogger(ClassRunner.class); - @SuppressWarnings("unchecked") private static final List> TEST_ANNOTATIONS = Lists.newArrayList(Test.class, UnitTest.class, ModuleTest.class, IntegrationTest.class, SystemTest.class, PerformanceTest.class, BugTest.class); private List expectedMethods; private int currentMethodIndex; diff --git a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/AllTests.java b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/AllTests.java index 2491d28938..61de9c14cc 100644 --- a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/AllTests.java +++ b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/AllTests.java @@ -10,22 +10,17 @@ *******************************************************************************/ package com.avaloq.tools.ddk.test.ui.test; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.test.ui.test.swtbot.DeChKeyboardLayoutTest; -import com.avaloq.tools.ddk.test.ui.test.swtbot.SwtBotRadioTest; /** * Empty class serving only as holder for JUnit4 annotations. */ @Suite -@SelectClasses({ -// @Format-Off - DeChKeyboardLayoutTest.class, - SwtBotRadioTest.class -// @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.test.ui.test.swtbot" }) -public class AllTests { +class AllTests { } diff --git a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/logging/ErrorLogListenerTest.java b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/logging/ErrorLogListenerTest.java index a5cb3d3b22..4882381395 100644 --- a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/logging/ErrorLogListenerTest.java +++ b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/logging/ErrorLogListenerTest.java @@ -26,14 +26,14 @@ /** * Tests the {@link ErrorLogListener}. */ -public class ErrorLogListenerTest { +class ErrorLogListenerTest { private ErrorLogListener errorLogListener; /** * Sets up the {@link ErrorLogListener} under test. */ @BeforeEach - public void setUp() { + void setUp() { errorLogListener = new ErrorLogListener(); errorLogListener.register(); } @@ -42,7 +42,7 @@ public void setUp() { * Tears down the {@link ErrorLogListener} under test. */ @AfterEach - public void tearDown() { + void tearDown() { errorLogListener.unregister(); } @@ -54,7 +54,7 @@ public void tearDown() { */ @Test @SuppressWarnings("nls") - public void testIgnoringExceptionLocations() throws InterruptedException { + void testIgnoringExceptionLocations() throws InterruptedException { assertFalse(errorLogListener.isExceptionLogged(NullPointerException.class), "NullPointerException must not have been logged."); errorLogListener.ignoreException(NullPointerException.class, "com.avaloq.tools.ddk.test.core.util.ErrorLogListenerTest"); diff --git a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/DeChKeyboardLayoutTest.java b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/DeChKeyboardLayoutTest.java index e65274a10b..f97611701a 100644 --- a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/DeChKeyboardLayoutTest.java +++ b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/DeChKeyboardLayoutTest.java @@ -23,14 +23,14 @@ * Checks if the DE_CH keyboard layout works correctly by typing special characters in a test Eclipse editor. */ @SuppressWarnings("nls") -public class DeChKeyboardLayoutTest { +class DeChKeyboardLayoutTest { private static final String EXPECTED_RESULT = "¨üöä$,.-[]ö{},.-\\'^+\"*ç%&/()=?`¦@#°§¬|¢´~zyZY"; /** * Tests com.avaloq.test.swtbot.DE_CH. */ @Test - public void testDeChKeyboardLayout() { + void testDeChKeyboardLayout() { SWTBotPreferences.KEYBOARD_LAYOUT = "com.avaloq.test.swtbot.DE_CH"; SWTBotPreferences.KEYBOARD_STRATEGY = "org.eclipse.swtbot.swt.finder.keyboard.MockKeyboardStrategy"; SwtWorkbenchBot bot = new SwtWorkbenchBot(); diff --git a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/SwtBotRadioTest.java b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/SwtBotRadioTest.java index a338355ede..d25c1d0bb2 100644 --- a/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/SwtBotRadioTest.java +++ b/com.avaloq.tools.ddk.test.ui.test/src/com/avaloq/tools/ddk/test/ui/test/swtbot/SwtBotRadioTest.java @@ -27,7 +27,7 @@ * Provides test for the SwtBotRadio. */ @SuppressWarnings("nls") -public class SwtBotRadioTest { +class SwtBotRadioTest { @RegisterExtension // CHECKSTYLE:CHECK-OFF VisibilityModifier @@ -59,7 +59,7 @@ public String getText() { * Test if the method {@link com.avaloq.tools.ddk.test.ui.swtbot.SwtBotRadio#click()} works correctly. */ @Test - public void testSwtRadioButtonClick() { + void testSwtRadioButtonClick() { SwtWorkbenchBot bot = new SwtWorkbenchBot(); bot.resetWorkbench(); testRadioButtonClick(bot); @@ -70,7 +70,7 @@ public void testSwtRadioButtonClick() { */ @Test @Issue(value = "DSL-371", fixed = false) - public void testSWTRadioButtonClick() { + void testSWTRadioButtonClick() { SWTWorkbenchBot bot = new SWTWorkbenchBot(); bot.resetWorkbench(); testRadioButtonClick(bot); diff --git a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/AbstractTypeProviderTest.java b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/AbstractTypeProviderTest.java index cf54677ec7..02a2dc82c2 100644 --- a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/AbstractTypeProviderTest.java +++ b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/AbstractTypeProviderTest.java @@ -34,7 +34,7 @@ @SuppressWarnings("nls") -public class AbstractTypeProviderTest { +class AbstractTypeProviderTest { protected class TypeImpl extends EObjectImpl implements IType { } diff --git a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/BuiltInTypeModelAccessTest.java b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/BuiltInTypeModelAccessTest.java index 4653a8775b..d694f46be7 100644 --- a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/BuiltInTypeModelAccessTest.java +++ b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/BuiltInTypeModelAccessTest.java @@ -28,7 +28,7 @@ * Tests that the BuiltInType model instance is correct and complete. */ @SuppressWarnings("nls") -public class BuiltInTypeModelAccessTest { +class BuiltInTypeModelAccessTest { @Test void testLoadModel() { diff --git a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/ParameterListMatcherTest.java b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/ParameterListMatcherTest.java index b83e0509d3..d252a16a75 100644 --- a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/ParameterListMatcherTest.java +++ b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/ParameterListMatcherTest.java @@ -37,7 +37,7 @@ // You can't have too many tests @SuppressWarnings({"PMD.ExcessivePublicCount", "nls"}) -public class ParameterListMatcherTest { +class ParameterListMatcherTest { private static final String WRONG_NUMBER_OF_UNNAMED_FORMALS_AFTER_NAMED_FORMALS = "wrong number of unnamed formals after named formals"; private static final String UNNAMED_FORMAL_AFTER_NAMED_NOT_LOCATED = "unnamed formal after named not located"; diff --git a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/test/TypeSystemTestSuite.java b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/test/TypeSystemTestSuite.java index 82b3a5f262..6fb5169cf3 100644 --- a/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/test/TypeSystemTestSuite.java +++ b/com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem/test/TypeSystemTestSuite.java @@ -10,25 +10,19 @@ *******************************************************************************/ package com.avaloq.tools.ddk.typesystem.test; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.typesystem.AbstractTypeProviderTest; -import com.avaloq.tools.ddk.typesystem.BuiltInTypeModelAccessTest; -import com.avaloq.tools.ddk.typesystem.ParameterListMatcherTest; - /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - AbstractTypeProviderTest.class, - BuiltInTypeModelAccessTest.class, - ParameterListMatcherTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.typesystem" }) -public class TypeSystemTestSuite { +@IncludeClassNamePatterns(".*Test.*") +class TypeSystemTestSuite { } diff --git a/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/layered/XtextBuildTrigger.java b/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/layered/XtextBuildTrigger.java index 27c181fe27..07e34ad48f 100644 --- a/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/layered/XtextBuildTrigger.java +++ b/com.avaloq.tools.ddk.xtext.builder/src/com/avaloq/tools/ddk/xtext/builder/layered/XtextBuildTrigger.java @@ -21,7 +21,7 @@ /** * Build trigger that actually does trigger a full build. Assumes we have a {@link IWorkspace} and a {@link BuildScheduler}. */ -@SuppressWarnings({"deprecation", "removal"}) +@SuppressWarnings({"deprecation"}) public class XtextBuildTrigger implements IXtextBuildTrigger { @Inject diff --git a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/exporting/ExportExportingTest.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/exporting/ExportExportingTest.java index a128765d2e..6ff4f01d80 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/exporting/ExportExportingTest.java +++ b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/exporting/ExportExportingTest.java @@ -20,7 +20,7 @@ * Tests exporting of Ddic sources. */ -public class ExportExportingTest extends AbstractXtextTest { // AbstractExportingTest { // TODO - AbstractExportingTest like AbstractExportingTest? +class ExportExportingTest extends AbstractXtextTest { // AbstractExportingTest { // TODO - AbstractExportingTest like AbstractExportingTest? @Override protected ExportTestUtil getXtextTestUtil() { @@ -28,7 +28,7 @@ protected ExportTestUtil getXtextTestUtil() { } @Test - public final void testExport() { + final void testExport() { // TODO - what should we test? } diff --git a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/formatting/ExportFormattingTest.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/formatting/ExportFormattingTest.java index 431855c9c8..96e063653c 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/formatting/ExportFormattingTest.java +++ b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/formatting/ExportFormattingTest.java @@ -19,7 +19,7 @@ * Tests formatting of Export source fragments. */ @SuppressWarnings("nls") -public class ExportFormattingTest extends AbstractFormattingTest { +class ExportFormattingTest extends AbstractFormattingTest { @Override protected ExportTestUtil getXtextTestUtil() { diff --git a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.java index 67f16199e7..3c97dd4c37 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.java +++ b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.java @@ -30,7 +30,7 @@ * Tests scoping of Code Tab Data Source */ @SuppressWarnings("nls") -public class ExportScopingTest extends AbstractScopingTest { +class ExportScopingTest extends AbstractScopingTest { public ExportScopingTest() { super(new NullMapper()); } @@ -43,7 +43,7 @@ protected ExportTestUtil getXtextTestUtil() { } @Test - public void testImportPackageScope() throws IOException { + void testImportPackageScope() throws IOException { ExportModel model = (ExportModel) getTestSource().getModel(); IScope scope = scopeProvider.scope_Import_package(model.getImports().get(0), ExportPackage.Literals.IMPORT__PACKAGE); assertNotNull(scope.getSingleElement(QualifiedName.create("http://www.avaloq.com/tools/ddk/xtext/export/Export")), "Could not locate Import."); @@ -51,7 +51,7 @@ public void testImportPackageScope() throws IOException { } @Test - public void testEclassScope() throws IOException { + void testEclassScope() throws IOException { ExportModel model = (ExportModel) getTestSource().getModel(); IScope scope = scopeProvider.scope_EClass(model, null); assertNotNull(scope.getSingleElement(QualifiedName.create("InterfaceExpression")), "Could not locate EClass."); @@ -59,7 +59,7 @@ public void testEclassScope() throws IOException { } @Test - public void testEStructuralFeatureScope() throws IOException { + void testEStructuralFeatureScope() throws IOException { ExportModel model = (ExportModel) getTestSource().getModel(); IScope scope = scopeProvider.scope_EStructuralFeature(model.getInterfaces().get(0), null); // CHECKSTYLE:OFF (DuplicateString) @@ -69,7 +69,7 @@ public void testEStructuralFeatureScope() throws IOException { } @Test - public void testEAttributeScope() throws IOException { + void testEAttributeScope() throws IOException { ExportModel model = (ExportModel) getTestSource().getModel(); IScope scope = scopeProvider.scope_EAttribute(model.getInterfaces().get(0), null); // CHECKSTYLE:OFF (DuplicateString) @@ -79,7 +79,7 @@ public void testEAttributeScope() throws IOException { } @Test - public void testInterfaceNavigationRefScope() throws IOException { + void testInterfaceNavigationRefScope() throws IOException { ExportModel model = (ExportModel) getTestSource().getModel(); IScope scope = scopeProvider.scope_InterfaceNavigation_ref(model.getInterfaces().get(0), null); // CHECKSTYLE:OFF (DuplicateString) diff --git a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationOkTest.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationOkTest.java index ca1b97faa7..b1f61fee0c 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationOkTest.java +++ b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationOkTest.java @@ -19,7 +19,7 @@ /** * Tests validation of Export sources. */ -public class ExportValidationOkTest extends AbstractValidationTest { +class ExportValidationOkTest extends AbstractValidationTest { @Override protected ExportTestUtil getXtextTestUtil() { @@ -27,7 +27,7 @@ protected ExportTestUtil getXtextTestUtil() { } @Test - public final void testCheckAll() { + final void testCheckAll() { assertNoDiagnostics(); } diff --git a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationTest.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationTest.java index 3eaa8fac2c..87f1c72471 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationTest.java +++ b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationTest.java @@ -20,7 +20,7 @@ * Tests validation of Export sources. */ @SuppressWarnings("nls") -public class ExportValidationTest extends AbstractValidationTest { +class ExportValidationTest extends AbstractValidationTest { @Override protected ExportTestUtil getXtextTestUtil() { @@ -28,28 +28,28 @@ protected ExportTestUtil getXtextTestUtil() { } @Test - public final void testCheckExtensions() { + final void testCheckExtensions() { // TODO cannot test as unable to load resource in test environment assertDiagnosticMessage("Extension 'XYZ' not found"); } @Test - public final void testCheckInterfaceAndExportUniqueness() { + final void testCheckInterfaceAndExportUniqueness() { assertDiagnosticMessage("declaration duplicate found: ecore::EClass"); } @Test - public final void testCheckExportFieldUniqueness() { + final void testCheckExportFieldUniqueness() { assertDiagnosticMessage("duplicate found: instanceClassName"); } @Test - public final void testCheckUserDataNameAsFeature() { + final void testCheckUserDataNameAsFeature() { assertDiagnosticMessage("instanceClassName is already defined as field"); // TODO assertDiagnosticMessage("xxx has the same name as an existing feature"); } @Test - public final void testCheckOverlap() { + final void testCheckOverlap() { // TODO assertDiagnosticMessage(""); } diff --git a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/test/export/ExportTestSuite.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/test/export/ExportTestSuite.java index 1eee326800..52f1d82590 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/test/export/ExportTestSuite.java +++ b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/test/export/ExportTestSuite.java @@ -10,19 +10,21 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext.test.export; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.xtext.export.exporting.ExportExportingTest; -import com.avaloq.tools.ddk.xtext.export.formatting.ExportFormattingTest; -import com.avaloq.tools.ddk.xtext.export.scoping.ExportScopingTest; -import com.avaloq.tools.ddk.xtext.export.validation.ExportValidationTest; - /** - * Empty class serving only as holder for JUnit4 annotations. + * Empty class serving only as holder for JUnit5 annotations. */ @Suite -@SelectClasses({ExportFormattingTest.class, ExportValidationTest.class, ExportScopingTest.class, ExportExportingTest.class}) -public class ExportTestSuite { +@SelectPackages({ + "com.avaloq.tools.ddk.xtext.export.exporting", + "com.avaloq.tools.ddk.xtext.export.formatting", + "com.avaloq.tools.ddk.xtext.export.scoping", + "com.avaloq.tools.ddk.xtext.export.validation" +}) +@IncludeClassNamePatterns(".*Test.*") +class ExportTestSuite { } diff --git a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/builder/FormatBuilderParticipantTest.java b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/builder/FormatBuilderParticipantTest.java index a6bfd8bc35..a628900875 100644 --- a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/builder/FormatBuilderParticipantTest.java +++ b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/builder/FormatBuilderParticipantTest.java @@ -36,7 +36,7 @@ * A test class for {@link FormatBuilderParticipant} and com.avaloq.tools.ddk.xtext.ui.builder.AbstractConditionalBuilderParticipant */ @SuppressWarnings("nls") -public class FormatBuilderParticipantTest extends AbstractXtextTest { +class FormatBuilderParticipantTest extends AbstractXtextTest { private static final String TEST_PROJECT_NAME = "resource"; @@ -68,7 +68,7 @@ protected void beforeAllTests() { * Tests whether a {@link Delta} resource has a correct extension to be used by org.eclipse.xtext.builder.BuilderParticipant. */ @Test - public void hasCorrectExtensionTest() { + void hasCorrectExtensionTest() { IResourceServiceProvider resourceServiceProvider = mock(IResourceServiceProvider.class); when(resourceServiceProvider.canHandle(argThat(new IsUri()))).thenReturn(true, false); assertTrue(participant.hasCorrectExtension(delta, resourceServiceProvider), "Check if the delta resource has correct extension"); @@ -79,7 +79,7 @@ public void hasCorrectExtensionTest() { * Tests whether a {@link Delta} resource comes form the right (SRC) directory to be used by org.eclipse.xtext.builder.BuilderParticipant. */ @Test - public void isSourceOriginatedTest() { + void isSourceOriginatedTest() { when(uriCorrect.segments()).thenReturn(CORRECT_URI_SEGMENTS); assertTrue(participant.isSourceOriginated(delta), "Check if the delta resource has correct URI and comes from SRC directory"); when(uriCorrect.segments()).thenReturn(BIN_URI_SEGMENTS); diff --git a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/formatting/FormatFormattingTest.java b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/formatting/FormatFormattingTest.java index 0da7073bd3..bcd5d97f9a 100644 --- a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/formatting/FormatFormattingTest.java +++ b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/formatting/FormatFormattingTest.java @@ -15,7 +15,7 @@ import com.avaloq.tools.ddk.xtext.test.jupiter.AbstractFormattingTest; -public class FormatFormattingTest extends AbstractFormattingTest { +class FormatFormattingTest extends AbstractFormattingTest { @Override protected FormatTestUtil getXtextTestUtil() { diff --git a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/scoping/FormatScopingTest.java b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/scoping/FormatScopingTest.java index d088a6a148..791bff5d3d 100644 --- a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/scoping/FormatScopingTest.java +++ b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/scoping/FormatScopingTest.java @@ -44,7 +44,7 @@ * Scoping tests for the Format DSL. */ @SuppressWarnings("nls") -public class FormatScopingTest extends AbstractScopingTest { +class FormatScopingTest extends AbstractScopingTest { private static final String C_FORMAT = "C.format"; private static final String C_XTEXT = "C.xtext"; @@ -103,13 +103,13 @@ protected void beforeEachTest() { * Tests that all grammars' rules are scoped. */ @Test - public void allGrammarsScoped() { + void allGrammarsScoped() { Set expectedURIs = Sets.newHashSet(EcoreUtil.getURI(grammarC.getRules().get(0)), EcoreUtil.getURI(grammarB.getRules().get(0)), EcoreUtil.getURI(grammarA.getRules().get(0)), EcoreUtil.getURI(grammarA.getRules().get(1))); assertScope(formatC, FormatPackage.Literals.GRAMMAR_RULE__TARGET_RULE, expectedURIs); } @Test - public void keywordScoped() { + void keywordScoped() { AbstractRule parserRuleA = grammarA.getRules().get(0); Set keywordURIs = Sets.newHashSet(Iterables.transform(GrammarUtil.containedKeywords(parserRuleA), TO_URI)); assertFalse(keywordURIs.isEmpty(), "No keywords found"); @@ -125,7 +125,7 @@ public void keywordScoped() { * Verify assignemnts (=a, =b ...) are scoped. */ @Test - public void assignmentScoped() { + void assignmentScoped() { AbstractRule parserRuleA = grammarA.getRules().get(0); Set assignmentURIs = Sets.newHashSet(Iterables.transform(GrammarUtil.containedAssignments(parserRuleA), TO_URI)); assertFalse(assignmentURIs.isEmpty(), "No assignments found"); @@ -137,7 +137,7 @@ public void assignmentScoped() { * Verify Rule { @Rule : ...}. */ @Test - public void ruleCallScoped() { + void ruleCallScoped() { AbstractRule parserRuleAA = grammarA.getRules().get(1); Set ruleCallURIs = Sets.newHashSet(Iterables.transform(GrammarUtil.containedRuleCalls(parserRuleAA), TO_URI)); assertScope(formatA.getRules().get(1), FormatPackage.Literals.GRAMMAR_ELEMENT_REFERENCE__RULE_CALL, ruleCallURIs); @@ -148,13 +148,13 @@ public void ruleCallScoped() { * Verify Rule { rule : ...}. */ @Test - public void ruleSelfScoped() { + void ruleSelfScoped() { AbstractRule parserRuleA = grammarA.getRules().get(0); assertScope(formatC.getRules().get(0), FormatPackage.Literals.GRAMMAR_ELEMENT_REFERENCE__SELF, TO_URI.apply(parserRuleA)); } @Test - public void groupScoped() { + void groupScoped() { ParserRule parserRuleA = (ParserRule) grammarA.getRules().get(0); CompoundElement group1 = findSemanticElementByString("(", CompoundElement.class, parserRuleA); // ('-' b=STRING | ('-'c=ID ('-'d=INT | '-'e=STRING)))? diff --git a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/validation/FormatValidationTest.java b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/validation/FormatValidationTest.java index 62a80a86b3..76384bba4b 100644 --- a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/validation/FormatValidationTest.java +++ b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/format/validation/FormatValidationTest.java @@ -24,7 +24,7 @@ @SuppressWarnings("nls") -public class FormatValidationTest extends AbstractValidationTest { +class FormatValidationTest extends AbstractValidationTest { private static final String INT_EXP_RULE = "INT_EXP {}"; private static final String WILDCARD_RULE = "* {}"; private static final String OVERRIDE_INT_EXP_RULE = "override " + INT_EXP_RULE; @@ -104,7 +104,7 @@ private FormatConfiguration createModel(final String formatName, final String ex * Tests that non-'rule' directives are invalid in a terminal rule context. */ @Test - public void testNegativeACF1000() { + void testNegativeACF1000() { setFormattingRules(new String[0], "INT_EXP { \"e\" : no_space around;}"); assertDiagnostic(parentFormat, FormatValidator.ILLEGAL_DIRECTIVE_CODE); } @@ -113,7 +113,7 @@ public void testNegativeACF1000() { * Tests that 'rule' directives are valid in a terminal rule context. */ @Test - public void testPositiveACF1000() { + void testPositiveACF1000() { setFormattingRules(new String[0], "INT_EXP { rule : no_space around;}"); assertNoDiagnostic(parentFormat, FormatValidator.ILLEGAL_DIRECTIVE_CODE); } @@ -122,7 +122,7 @@ public void testPositiveACF1000() { * Verify that IllegalOverride validation issues error for WildcardRules. */ @Test - public void illegalWildcardRuleOverride() { + void illegalWildcardRuleOverride() { setFormattingRules(new String[] {OVERRIDE_WILDCARD_RULE}); assertDiagnostic(extendingFormat, FormatValidator.OVERRIDE_ILLEGAL_CODE); } @@ -131,7 +131,7 @@ public void illegalWildcardRuleOverride() { * Verify that IllegalOverride validation issues error for GrammarRules. */ @Test - public void illegalGrammarRuleOverride() { + void illegalGrammarRuleOverride() { setFormattingRules(new String[] {OVERRIDE_INT_EXP_RULE}); assertDiagnostic(extendingFormat, FormatValidator.OVERRIDE_ILLEGAL_CODE); } @@ -140,7 +140,7 @@ public void illegalGrammarRuleOverride() { * Verify that OverrideMissing validation issues error for WildcardRules. */ @Test - public void missingWildcardRuleOverride() { + void missingWildcardRuleOverride() { setFormattingRules(new String[] {WILDCARD_RULE}, WILDCARD_RULE); assertDiagnostic(extendingFormat, FormatValidator.OVERRIDE_MISSING_CODE); @@ -150,7 +150,7 @@ public void missingWildcardRuleOverride() { * Verify that OverrideMissing validation issues error for GrammarRules. */ @Test - public void missingGrammarRuleOverride() { + void missingGrammarRuleOverride() { setFormattingRules(new String[] {INT_EXP_RULE}, INT_EXP_RULE); assertDiagnostic(extendingFormat, FormatValidator.OVERRIDE_MISSING_CODE); } @@ -159,7 +159,7 @@ public void missingGrammarRuleOverride() { * Verify that OverrideMissing nor IllegalOverride validations issue no error. */ @Test - public void wildcardRuleOverrideOK() { + void wildcardRuleOverrideOK() { setFormattingRules(new String[] {OVERRIDE_WILDCARD_RULE}, WILDCARD_RULE); assertNoDiagnostic(extendingFormat, FormatValidator.OVERRIDE_MISSING_CODE); assertNoDiagnostic(extendingFormat, FormatValidator.OVERRIDE_ILLEGAL_CODE); @@ -169,7 +169,7 @@ public void wildcardRuleOverrideOK() { * Verify that OverrideMissing nor IllegalOverride validations issue no error. */ @Test - public void grammarRuleOverrideOK() { + void grammarRuleOverrideOK() { setFormattingRules(new String[] {OVERRIDE_INT_EXP_RULE}, INT_EXP_RULE); assertNoDiagnostic(extendingFormat, FormatValidator.OVERRIDE_MISSING_CODE); assertNoDiagnostic(extendingFormat, FormatValidator.OVERRIDE_ILLEGAL_CODE); @@ -179,7 +179,7 @@ public void grammarRuleOverrideOK() { * Verify that ExtendedGrammarCompatible validation issues error when grammars of the Format models are incompatible. */ @Test - public void extendedGrammarCompatible() { + void extendedGrammarCompatible() { try { getXtextTestUtil().getModel("MyDsl.xtext", "grammar com.avaloq.tools.ddk.xtext.format.validation.MyDsl\nimport \"http://www.eclipse.org/emf/2002/Ecore\" as ecore\nRule: 'rule';"); } catch (IOException e) { @@ -193,7 +193,7 @@ public void extendedGrammarCompatible() { * Verify that ExtendedGrammarCompatible validation issues no error. */ @Test - public void extendedGrammarCompatibleOK() { + void extendedGrammarCompatibleOK() { createModel(PARENT_MODEL_NAME, null); FormatConfiguration extendModel = createModel(EXTENDING_MODEL_NAME, PARENT_MODEL_NAME); assertNoDiagnostic(extendModel, FormatValidator.EXTENDED_GRAMMAR_INCOMPATIBLE_CODE); @@ -204,7 +204,7 @@ public void extendedGrammarCompatibleOK() { * formatting rule must be defined in the extending configuration if it is defined in the parent. */ @Test - public void requiredRulesImplemented() { + void requiredRulesImplemented() { setFormattingRules(new String[0], "Rule {}"); assertDiagnostic(extendingFormat, FormatValidator.GRAMMAR_RULE_MISSING_CODE); } diff --git a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/test/format/FormatTestSuite.java b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/test/format/FormatTestSuite.java index 4baf7095fe..3ae064a798 100644 --- a/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/test/format/FormatTestSuite.java +++ b/com.avaloq.tools.ddk.xtext.format.test/src/com/avaloq/tools/ddk/xtext/test/format/FormatTestSuite.java @@ -10,20 +10,22 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext.test.format; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.xtext.format.builder.FormatBuilderParticipantTest; -import com.avaloq.tools.ddk.xtext.format.formatting.FormatFormattingTest; -import com.avaloq.tools.ddk.xtext.format.scoping.FormatScopingTest; -import com.avaloq.tools.ddk.xtext.format.validation.FormatValidationTest; - /** * Empty class serving only as holder for JUnit5 annotations. */ @Suite -@SelectClasses({FormatFormattingTest.class, FormatValidationTest.class, FormatScopingTest.class, FormatBuilderParticipantTest.class}) -public class FormatTestSuite { +@SelectPackages({ + "com.avaloq.tools.ddk.xtext.format.builder", + "com.avaloq.tools.ddk.xtext.format.formatting", + "com.avaloq.tools.ddk.xtext.format.scoping", + "com.avaloq.tools.ddk.xtext.format.validation" +}) +@IncludeClassNamePatterns(".*Test.*") +class FormatTestSuite { } diff --git a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CodeGenerationXTest.java b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CodeGenerationXTest.java index 772a8220f5..02f4404b32 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CodeGenerationXTest.java +++ b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CodeGenerationXTest.java @@ -31,7 +31,7 @@ * Tests the code generation as implemented by CodeGenerationX wrapped by {@link CompilerX}. */ @SuppressWarnings({"nls", "PMD.SignatureDeclareThrowsException"}) -public class CodeGenerationXTest extends AbstractXtextTest { +class CodeGenerationXTest extends AbstractXtextTest { private CompilerX getCompiler() { return (CompilerX) getTestInformation().getTestObject(CompilerX.class); diff --git a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CompilationContextTest.java b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CompilationContextTest.java index b0ada1b629..e50f0dad51 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CompilationContextTest.java +++ b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/CompilationContextTest.java @@ -27,7 +27,7 @@ @SuppressWarnings({"nls", "PMD.SignatureDeclareThrowsException"}) -public class CompilationContextTest { +class CompilationContextTest { @Test void isExtension() { diff --git a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/ExpressionsExtentionsTest.java b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/ExpressionsExtentionsTest.java index 541d9f785e..2747b04f0d 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/ExpressionsExtentionsTest.java +++ b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/expression/ExpressionsExtentionsTest.java @@ -23,7 +23,7 @@ @SuppressWarnings("nls") -public class ExpressionsExtentionsTest extends AbstractXtextTest { +class ExpressionsExtentionsTest extends AbstractXtextTest { @Override protected GeneratorTestUtil getXtextTestUtil() { diff --git a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/generator/GeneratorTestSuite.java b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/generator/GeneratorTestSuite.java index d4c3f4ed0a..c798d052e5 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/generator/GeneratorTestSuite.java +++ b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/generator/GeneratorTestSuite.java @@ -10,29 +10,18 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext.generator.test.generator; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.xtext.generator.expression.CodeGenerationXTest; -import com.avaloq.tools.ddk.xtext.generator.expression.CompilationContextTest; -import com.avaloq.tools.ddk.xtext.generator.expression.ExpressionsExtentionsTest; -import com.avaloq.tools.ddk.xtext.generator.test.util.EClassComparatorTest; -import com.avaloq.tools.ddk.xtext.generator.test.util.GraphTest; /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ -// @Format-Off - CodeGenerationXTest.class, - CompilationContextTest.class, - ExpressionsExtentionsTest.class, - EClassComparatorTest.class, - GraphTest.class - // @Format-On +@SelectPackages({ + "com.avaloq.tools.ddk.xtext.generator.test.util" }) -public class GeneratorTestSuite { +class GeneratorTestSuite { } diff --git a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/EClassComparatorTest.java b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/EClassComparatorTest.java index acd767479c..a2273e0be9 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/EClassComparatorTest.java +++ b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/EClassComparatorTest.java @@ -33,7 +33,7 @@ @SuppressWarnings("PMD.JUnitAssertionsShouldIncludeMessage") -public class EClassComparatorTest { +class EClassComparatorTest { private final Function mapping = Functions. identity(); diff --git a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/GraphTest.java b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/GraphTest.java index d8a7a3316d..e1fd0b23bc 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/GraphTest.java +++ b/com.avaloq.tools.ddk.xtext.generator.test/src/com/avaloq/tools/ddk/xtext/generator/test/util/GraphTest.java @@ -25,7 +25,7 @@ @SuppressWarnings({"PMD.JUnitAssertionsShouldIncludeMessage", "nls"}) -public class GraphTest { +class GraphTest { // CHECKSTYLE:CONSTANTS-OFF @Test diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java index 569fc457e7..33bb772e92 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/contentassist/AbstractAcfContentAssistTest.java @@ -188,7 +188,6 @@ protected void assertExactlyCompletionProposal(final ICompletionProposal[] compu * @param sourceFileName * the filename of the test source that the proposals were to be computed from, must not be {@code null} */ - @SuppressWarnings("restriction") private void assertSourceProposals(final String sourceFileName) { try { AcfContentAssistProcessorTestBuilder builder = newBuilder().append(getTestSource(sourceFileName).getContent()); diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/formatting/AbstractFormattingTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/formatting/AbstractFormattingTest.java index 7fa54de3e4..51654a5bc5 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/formatting/AbstractFormattingTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/formatting/AbstractFormattingTest.java @@ -69,7 +69,7 @@ protected String getExpectedTestSourceFileName() { * Test formatting based on the NodeModel. */ @Test - public void formattedNodeModel() { + void formattedNodeModel() { assertFormattedNodeModel(); } @@ -91,7 +91,7 @@ public void preservedParseTreeConstructor() { * Test preservation of formatting using NodeModelFormatter. */ @Test - public void preservedNodeModel() { + void preservedNodeModel() { assertPreservedNodeModel(); } diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/generator/AbstractGeneratorTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/generator/AbstractGeneratorTest.java index 1877aebb2f..01165a2a3c 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/generator/AbstractGeneratorTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/generator/AbstractGeneratorTest.java @@ -60,7 +60,7 @@ /** * A base class for xtext generator tests. Allows creating a project and adding files. */ -@SuppressWarnings({"PMD.AbstractClassWithoutAbstractMethod", "restriction", "nls"}) +@SuppressWarnings({"PMD.AbstractClassWithoutAbstractMethod", "nls"}) public abstract class AbstractGeneratorTest { private static final String MESSAGE_GENERATED_FILE_MUST_EXIST = "Generated file ''{0}'' must exist."; private static final String MESSAGE_GENERATED_CODE_MUST_BE_CORRECT = "Generated contents of ''{0}'' must be correct."; diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/junit/runners/XtextClassRunner.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/junit/runners/XtextClassRunner.java index b616167c5c..7124d8f2e3 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/junit/runners/XtextClassRunner.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/junit/runners/XtextClassRunner.java @@ -101,7 +101,6 @@ public class XtextClassRunner extends XtextRunner { public static final String PROPERTY_UNSTABLE_FAIL = "com.avaloq.test.unstablefail"; //$NON-NLS-1$ /** Class-wide logger. */ private static final Logger LOGGER = LogManager.getLogger(XtextClassRunner.class); - @SuppressWarnings("unchecked") private static final List> TEST_ANNOTATIONS = Lists.newArrayList(Test.class, UnitTest.class, ModuleTest.class, IntegrationTest.class, SystemTest.class, PerformanceTest.class, BugTest.class); private List expectedMethods; private int currentMethodIndex; diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractAcfContentAssistTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractAcfContentAssistTest.java index aa945db99f..e0f0f9794c 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractAcfContentAssistTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractAcfContentAssistTest.java @@ -187,7 +187,6 @@ protected void assertExactlyCompletionProposal(final ICompletionProposal[] compu * @param sourceFileName * the filename of the test source that the proposals were to be computed from, must not be {@code null} */ - @SuppressWarnings("restriction") private void assertSourceProposals(final String sourceFileName) { try { AcfContentAssistProcessorTestBuilder builder = newBuilder().append(getTestSource(sourceFileName).getContent()); diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractFormattingTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractFormattingTest.java index b2d495908b..51ecf4eeca 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractFormattingTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter/AbstractFormattingTest.java @@ -68,7 +68,7 @@ protected String getExpectedTestSourceFileName() { * Test formatting based on the NodeModel. */ @Test - public void formattedNodeModel() { + void formattedNodeModel() { assertFormattedNodeModel(); } @@ -90,7 +90,7 @@ public void preservedParseTreeConstructor() { * Test preservation of formatting using NodeModelFormatter. */ @Test - public void preservedNodeModel() { + void preservedNodeModel() { assertPreservedNodeModel(); } diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/labeling/AbstractLabelingTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/labeling/AbstractLabelingTest.java index e5b728d927..5503e9ef55 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/labeling/AbstractLabelingTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/labeling/AbstractLabelingTest.java @@ -51,7 +51,7 @@ protected List> getExpectedElementLabels() { * Tests that the expected elements and their labels are exactly identical to all elements of the default test resource. */ @Test - public void testLabels() { + void testLabels() { if (getExpectedElementLabels() == null) { return; // TODO: remove this check once all tests have been refactored } diff --git a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/outline/AbstractOutlineTest.java b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/outline/AbstractOutlineTest.java index 4aed592467..fcaacb6811 100644 --- a/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/outline/AbstractOutlineTest.java +++ b/com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/ui/outline/AbstractOutlineTest.java @@ -55,7 +55,7 @@ protected List getExpectedElements() { * Tests that the outline of the default test resource contains exactly the expected elements. */ @Test - public void testOutline() { + void testOutline() { if (getExpectedElements() == null) { return; // TODO: remove this once all tests have been refactored } diff --git a/com.avaloq.tools.ddk.xtext.test/pom.xml b/com.avaloq.tools.ddk.xtext.test/pom.xml index 663983c34b..5e47532af5 100644 --- a/com.avaloq.tools.ddk.xtext.test/pom.xml +++ b/com.avaloq.tools.ddk.xtext.test/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 ddk-parent @@ -19,7 +20,11 @@ false false - ${test.testClass} + + + + **/*Test.java + false false true diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/AllTests.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/AllTests.java deleted file mode 100644 index 4915382915..0000000000 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/AllTests.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 Avaloq Group AG and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Avaloq Group AG - initial API and implementation - *******************************************************************************/ -package com.avaloq.tools.ddk.xtext; - -import org.junit.platform.suite.api.SelectClasses; -import org.junit.platform.suite.api.Suite; - -import com.avaloq.tools.ddk.check.runtime.test.core.CheckRuntimeTestSuite; -import com.avaloq.tools.ddk.check.test.core.CheckCoreTestSuite; -import com.avaloq.tools.ddk.check.test.runtime.tests.CheckExecutionEnvironmentTestSuite; -import com.avaloq.tools.ddk.check.test.runtime.tests.CheckLibraryChecksTestSuite; -import com.avaloq.tools.ddk.check.ui.test.CheckUiTestSuite; -import com.avaloq.tools.ddk.checkcfg.test.CheckCfgTestSuite; -import com.avaloq.tools.ddk.checkcfg.ui.test.CheckCfgUiTestSuite; -import com.avaloq.tools.ddk.sample.helloworld.test.HelloWorldSampleTestSuite; -import com.avaloq.tools.ddk.typesystem.test.TypeSystemTestSuite; -import com.avaloq.tools.ddk.xtext.generator.test.generator.GeneratorTestSuite; -import com.avaloq.tools.ddk.xtext.test.export.ExportTestSuite; -import com.avaloq.tools.ddk.xtext.test.format.FormatTestSuite; -import com.avaloq.tools.ddk.xtext.ui.test.XtextUiTestSuite; - - -/** - * Empty class serving only as holder for JUnit4 annotations. - */ -// CHECKSTYLE:OFF HideUtilityClassConstructor - -// @Format-Off -@Suite -@SelectClasses({ - XtextTestSuite.class, - XtextUiTestSuite.class, - GeneratorTestSuite.class, - FormatTestSuite.class, - ExportTestSuite.class, - HelloWorldSampleTestSuite.class, - CheckRuntimeTestSuite.class, - CheckCoreTestSuite.class, - CheckExecutionEnvironmentTestSuite.class, - CheckLibraryChecksTestSuite.class, - CheckUiTestSuite.class, - CheckCfgUiTestSuite.class, - CheckCfgTestSuite.class, - TypeSystemTestSuite.class -}) -// @Format-On -public class AllTests { -} diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/XtextTestSuite.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/XtextTestSuite.java deleted file mode 100644 index 4bc9db01cc..0000000000 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/XtextTestSuite.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 Avaloq Group AG and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Avaloq Group AG - initial API and implementation - *******************************************************************************/ -package com.avaloq.tools.ddk.xtext; - -import org.junit.platform.suite.api.SelectClasses; -import org.junit.platform.suite.api.Suite; - -import com.avaloq.tools.ddk.xtext.builder.XtextBuildTriggerTest; -import com.avaloq.tools.ddk.xtext.jupiter.formatter.FormatterTest; -import com.avaloq.tools.ddk.xtext.linking.AbstractFragmentProviderTest; -import com.avaloq.tools.ddk.xtext.linking.ShortFragmentProviderTest; -import com.avaloq.tools.ddk.xtext.naming.QualifiedNamePatternTest; -import com.avaloq.tools.ddk.xtext.naming.QualifiedNameSegmentTreeLookupTest; -import com.avaloq.tools.ddk.xtext.resource.AbstractSelectorFragmentProviderTest; -import com.avaloq.tools.ddk.xtext.resource.BugAig1084; -import com.avaloq.tools.ddk.xtext.resource.ResourceDescriptionDeltaTest; -import com.avaloq.tools.ddk.xtext.util.RuntimeProjectUtilTest; - - -/** - * Empty class serving only as holder for JUnit5 annotations. - */ -// @Format-Off -@Suite -@SelectClasses({ - AbstractFragmentProviderTest.class, - ShortFragmentProviderTest.class, - AbstractSelectorFragmentProviderTest.class, - ResourceDescriptionDeltaTest.class, - XtextBuildTriggerTest.class, - FormatterTest.class, - QualifiedNamePatternTest.class, - BugAig1084.class, - RuntimeProjectUtilTest.class, - QualifiedNameSegmentTreeLookupTest.class}) -// @Format-On -public class XtextTestSuite { -} diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java index 47642e3ecc..8966387959 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/builder/XtextBuildTriggerTest.java @@ -39,7 +39,7 @@ @SuppressWarnings({"restriction", "deprecation"}) @InjectWith(XtextBuilderInjectorProvider.class) @ExtendWith(InjectionExtension.class) -public class XtextBuildTriggerTest { +class XtextBuildTriggerTest { @Inject private Injector injector; @@ -48,13 +48,13 @@ public class XtextBuildTriggerTest { private BuildScheduler scheduler; @BeforeEach - public void setUp() { + void setUp() { workspace = injector.getInstance(IWorkspace.class); scheduler = injector.getInstance(BuildScheduler.class); } @Test - public void testTriggerRespectsAutoBuilding() { + void testTriggerRespectsAutoBuilding() { XtextBuildTrigger buildTrigger = injector.getInstance(XtextBuildTrigger.class); // auto-build disabled diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/formatter/FormatterTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/formatter/FormatterTest.java index 3a2013c06b..f4c8e4a40b 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/formatter/FormatterTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/formatter/FormatterTest.java @@ -28,7 +28,7 @@ * of the Xtext Formatter tests. */ @SuppressWarnings("nls") -public class FormatterTest extends AbstractFormatterTest { +class FormatterTest extends AbstractFormatterTest { @Override protected FormatterTestUtil getXtextTestUtil() { return FormatterTestUtil.getInstance(); @@ -49,7 +49,7 @@ protected String getTestSourceFileName() { * @throws IOException */ @Test - public void linewrap() throws IOException { + void linewrap() throws IOException { String model = "test linewrap float val; int x; double y;"; String expected = "test linewrap\nfloat val;\nint x;\ndouble y;"; assertFormattedPTC(expected, model); @@ -64,7 +64,7 @@ public void linewrap() throws IOException { * @throws IOException */ @Test - public void keepComments() throws IOException { + void keepComments() throws IOException { // String model = "test linewrap float val; int x; double y;"; String model = "// begincomment \ntest linewrap// comment1\n" + "float val;//comment2\n" + "int x;" + "double y; //yoyoyo!\n// endcomment."; final String exp = "// begincomment \ntest linewrap// comment1\n" + "float val;//comment2\n" + "int x;\n" + "double y; //yoyoyo!\n// endcomment."; @@ -79,7 +79,7 @@ public void keepComments() throws IOException { * @throws IOException */ @Test - public void column() throws IOException { + void column() throws IOException { String model = "test column item int x;"; String expected = "test\n column\n\titem int x;"; assertFormattedPTC(expected, model); @@ -94,7 +94,7 @@ public void column() throws IOException { * @throws IOException */ @Test - public void columnMinimumPadding() throws IOException { + void columnMinimumPadding() throws IOException { String model = " test column name item int x;"; String expected = "test\n column name\n\n\titem int x;"; assertFormattedPTC(expected, model); @@ -108,7 +108,7 @@ public void columnMinimumPadding() throws IOException { * @throws IOException */ @Test - public void offset() throws IOException { + void offset() throws IOException { String model = "test offset value v pair p1 p2"; String expected = "test\noffset\n\tvalue v\n\t\tpair p1 p2"; assertFormattedPTC(expected, model); @@ -122,7 +122,7 @@ public void offset() throws IOException { * @throws IOException */ @Test - public void rightPadding() throws IOException { + void rightPadding() throws IOException { String model = "test padding long_name n2;"; String expected = "test\npadding long_name n2 ;"; assertFormattedPTC(expected, model); @@ -137,7 +137,7 @@ public void rightPadding() throws IOException { * @throws IOException */ @Test - public void indentation() throws IOException { + void indentation() throws IOException { String model = "test indentation { float val; double y; indentation { int x; } }"; String expected = "test indentation {\n float val;\n double y;\n indentation {\n int x;\n }\n}"; assertFormattedPTC(expected, model); @@ -152,7 +152,7 @@ public void indentation() throws IOException { * @throws IOException */ @Test - public void association() throws IOException { + void association() throws IOException { String model = "test indentation { var = [0,1,2,3,4]; }"; String expected = "test indentation {\n var=[ 0, 1, 2, 3, 4 ];\n}"; assertFormattedPTC(expected, model); @@ -167,7 +167,7 @@ public void association() throws IOException { * @throws IOException */ @Test - public void indentationAndComments() throws IOException { + void indentationAndComments() throws IOException { String model = "test /* xxx */ indentation { float val; // some float\n double /* oo */ y; indentation { // some block\n int x; // xxx\n } } // final comment"; String expected = "test /* xxx */ indentation {\n float val; // some float\n double /* oo */ y;\n indentation { // some block\n int x; // xxx\n }\n} // final comment"; assertFormattedPTC(expected, model); @@ -183,7 +183,7 @@ public void indentationAndComments() throws IOException { * @throws IOException */ @Test - public void indentationAndLineWrap() throws IOException { + void indentationAndLineWrap() throws IOException { String model = "test indentation { void func(x:int,y:int,s:javalangString, foo:javasqlDate, blupp:mylongtype, msads:adshdjkhsakdasdkslajdlsask, x:x, a:b, c:d ); }"; String expected = "test indentation {\n void func(x:int,y:int,\n\t\ts:javalangString,\n\t\tfoo:javasqlDate,\n\t\tblupp:mylongtype,\n\t\tmsads:adshdjkhsakdasdkslajdlsask,\n\t\tx:x,a:b,c:d);\n}"; assertFormattedPTC(expected, model); @@ -198,7 +198,7 @@ public void indentationAndLineWrap() throws IOException { * @throws IOException */ @Test - public void between1() throws IOException { + void between1() throws IOException { String model = "test indentation { indentation { x x; }; }"; String expected = "test indentation {\n indentation {\n x x;\n };\n}"; assertFormattedPTC(expected, model); @@ -213,7 +213,7 @@ public void between1() throws IOException { * @throws IOException */ @Test - public void between2() throws IOException { + void between2() throws IOException { String model = "test indentation { indentation { x x; } }"; String expected = "test indentation {\n indentation {\n x x;\n }\n}"; assertFormattedPTC(expected, model); @@ -228,7 +228,7 @@ public void between2() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRule() throws IOException { + void linewrapDatatypeRule() throws IOException { String model = "test linewrap fqn ab; fqn xx.yy.zz;"; String expected = "test linewrap\nfqn\nab;\nfqn\nxx.yy.zz;"; assertFormattedPTC(expected, model); @@ -243,7 +243,7 @@ public void linewrapDatatypeRule() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRulePartial1() throws IOException { + void linewrapDatatypeRulePartial1() throws IOException { String model = "test linewrap fqn ab . xx .yy .zz;"; String expected = "test linewrap fqn ab.xx.yy.zz;"; assertFormattedNM(expected, model, 22, 2); @@ -256,7 +256,7 @@ public void linewrapDatatypeRulePartial1() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRulePartial2() throws IOException { + void linewrapDatatypeRulePartial2() throws IOException { String model = "test linewrap fqn ab . xx .yy .zz;fqn xxx;"; String expected = "test linewrap fqn\nab.xx.yy.zz;fqn xxx;"; assertFormattedNM(expected, model, 15, 10); @@ -269,7 +269,7 @@ public void linewrapDatatypeRulePartial2() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRulePartial3() throws IOException { + void linewrapDatatypeRulePartial3() throws IOException { String model = "test linewrap fqn ab . xx .yy .zz;fqn xxx;"; String expected = "test linewrap fqn ab.xx.yy.zz;\nfqn xxx;"; assertFormattedNM(expected, model, 25, 12); @@ -282,7 +282,7 @@ public void linewrapDatatypeRulePartial3() throws IOException { * @throws IOException */ @Test - public void formatSegment1() throws IOException { + void formatSegment1() throws IOException { String model = "test\nindentation {\n indentation { x x ; } }"; String expected = "test\nindentation {\n indentation {\n x x;\n } }"; assertFormattedNM(expected, model, 30, 18); @@ -295,7 +295,7 @@ public void formatSegment1() throws IOException { * @throws IOException */ @Test - public void formatSegment2() throws IOException { + void formatSegment2() throws IOException { String model = "test indentation {\n indentation { x x ; } }"; // String expected = // "test\nindentation {\n indentation {\n x x;\n } }"; @@ -309,7 +309,7 @@ public void formatSegment2() throws IOException { * @throws IOException */ @Test - public void formatSegment3() throws IOException { + void formatSegment3() throws IOException { String model = " test indentation {\n indentation { x x ; } }"; String expected = "test indentation {\n indentation {\n x x;\n }\n}"; assertFormattedNM(expected, model, 0, model.length()); @@ -322,7 +322,7 @@ public void formatSegment3() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRuleRef1() throws IOException { + void linewrapDatatypeRuleRef1() throws IOException { String model = "test linewrap fqn ab .cd .ef; fqnref ab. cd. ef;"; String expected = "test linewrap\nfqn\nab.cd.ef;\nfqnref\nab.cd.ef;"; // assertFormattedPTC(expected, model); @@ -336,7 +336,7 @@ public void linewrapDatatypeRuleRef1() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRuleRef2() throws IOException { + void linewrapDatatypeRuleRef2() throws IOException { String model = "test linewrap fqn ab.cd.ef; fqnref ab.cd.ef;"; String expected = "test linewrap\nfqn\nab.cd.ef;\nfqnref\nab.cd.ef;"; assertFormattedPTC(expected, model); @@ -352,7 +352,7 @@ public void linewrapDatatypeRuleRef2() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRuleComments() throws IOException { + void linewrapDatatypeRuleComments() throws IOException { String model = "test linewrap/* 1 */fqn/* 2 */ab.cd.ef/* 3 */;/* 4 */fqnref/* 5 */ab.cd.ef/* 6 */;/* 7 */"; // The expected model string differs from Xtext's - // Xtext does not expect a line wrap after the keyword "linewrap" @@ -371,7 +371,7 @@ public void linewrapDatatypeRuleComments() throws IOException { * @throws IOException */ @Test - public void enumeration() throws IOException { + void enumeration() throws IOException { String model = "test linewrap enum lit1,lit2,lit3,lit1;"; String expected = "test linewrap\nenum lit1 ,\nlit2,\nlit3,\nlit1;"; assertFormattedPTC(expected, model); @@ -387,7 +387,7 @@ public void enumeration() throws IOException { */ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=312559 @Test - public void suppressedWhitespace() throws IOException { + void suppressedWhitespace() throws IOException { String model = "test linewrap `f%%a` post;"; String expected = "test linewrap\n`f%< b >%a` post;"; assertFormattedPTC(expected, model); @@ -419,7 +419,7 @@ public void suppressedLinewrap() throws IOException { * @throws IOException */ @Test - public void linewrapMin() throws IOException { + void linewrapMin() throws IOException { String model = "test wrapminmax foo bar;"; String expected = "test wrapminmax\n\nfoo bar;"; assertFormattedPTC(expected, model); @@ -434,7 +434,7 @@ public void linewrapMin() throws IOException { * @throws IOException */ @Test - public void linewrapMax() throws IOException { + void linewrapMax() throws IOException { String model = "test wrapminmax\n\n\n\n\n\n\n\n\n\n\n\n\nfoo bar;"; String expected = "test wrapminmax\n\n\n\n\nfoo bar;"; assertFormattedPTC(expected, model); @@ -449,7 +449,7 @@ public void linewrapMax() throws IOException { * @throws IOException */ @Test - public void linewrapKeep() throws IOException { + void linewrapKeep() throws IOException { String model = "test wrapminmax\n\n\n\nfoo bar;"; assertFormattedPTC(model, model); assertFormattedNM(model, model, 0, model.length()); @@ -463,7 +463,7 @@ public void linewrapKeep() throws IOException { * @throws IOException */ @Test - public void linewrapDefault() { + void linewrapDefault() { FormatterTestLanguageFactory f = FormatterTestLanguageFactory.eINSTANCE; TestLinewrapMinMax m = f.createTestLinewrapMinMax(); Decl d = f.createDecl(); @@ -482,7 +482,7 @@ public void linewrapDefault() { * @throws IOException */ @Test - public void space() throws IOException { + void space() throws IOException { String model = "test linewrap space foo;"; String expected = "test linewrap\nspace foo;"; assertFormattedPTC(expected, model); @@ -497,7 +497,7 @@ public void space() throws IOException { * @throws IOException */ @Test - public void datatypeRules() throws IOException { + void datatypeRules() throws IOException { String model = "test linewrap datatypes abc kw1 bcd def kw3;"; String expected = "test linewrap\ndatatypes abc\nkw1\nbcd\ndef\nkw3;"; assertFormattedPTC(expected, model); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/jupiter/formatter/FormatterTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/jupiter/formatter/FormatterTest.java index 63fb4f7a4c..82a8c3ab70 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/jupiter/formatter/FormatterTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/jupiter/formatter/FormatterTest.java @@ -28,7 +28,7 @@ * of the Xtext Formatter tests. */ @SuppressWarnings("nls") -public class FormatterTest extends AbstractFormatterTest { +class FormatterTest extends AbstractFormatterTest { @Override protected FormatterTestUtil getXtextTestUtil() { return FormatterTestUtil.getInstance(); @@ -49,7 +49,7 @@ protected String getTestSourceFileName() { * @throws IOException */ @Test - public void linewrap() throws IOException { + void linewrap() throws IOException { String model = "test linewrap float val; int x; double y;"; String expected = "test linewrap\nfloat val;\nint x;\ndouble y;"; assertFormattedPTC(expected, model); @@ -64,7 +64,7 @@ public void linewrap() throws IOException { * @throws IOException */ @Test - public void keepComments() throws IOException { + void keepComments() throws IOException { // String model = "test linewrap float val; int x; double y;"; String model = "// begincomment \ntest linewrap// comment1\n" + "float val;//comment2\n" + "int x;" + "double y; //yoyoyo!\n// endcomment."; final String exp = "// begincomment \ntest linewrap// comment1\n" + "float val;//comment2\n" + "int x;\n" + "double y; //yoyoyo!\n// endcomment."; @@ -79,7 +79,7 @@ public void keepComments() throws IOException { * @throws IOException */ @Test - public void column() throws IOException { + void column() throws IOException { String model = "test column item int x;"; String expected = "test\n column\n\titem int x;"; assertFormattedPTC(expected, model); @@ -94,7 +94,7 @@ public void column() throws IOException { * @throws IOException */ @Test - public void columnMinimumPadding() throws IOException { + void columnMinimumPadding() throws IOException { String model = " test column name item int x;"; String expected = "test\n column name\n\n\titem int x;"; assertFormattedPTC(expected, model); @@ -108,7 +108,7 @@ public void columnMinimumPadding() throws IOException { * @throws IOException */ @Test - public void offset() throws IOException { + void offset() throws IOException { String model = "test offset value v pair p1 p2"; String expected = "test\noffset\n\tvalue v\n\t\tpair p1 p2"; assertFormattedPTC(expected, model); @@ -122,7 +122,7 @@ public void offset() throws IOException { * @throws IOException */ @Test - public void rightPadding() throws IOException { + void rightPadding() throws IOException { String model = "test padding long_name n2;"; String expected = "test\npadding long_name n2 ;"; assertFormattedPTC(expected, model); @@ -137,7 +137,7 @@ public void rightPadding() throws IOException { * @throws IOException */ @Test - public void indentation() throws IOException { + void indentation() throws IOException { String model = "test indentation { float val; double y; indentation { int x; } }"; String expected = "test indentation {\n float val;\n double y;\n indentation {\n int x;\n }\n}"; assertFormattedPTC(expected, model); @@ -152,7 +152,7 @@ public void indentation() throws IOException { * @throws IOException */ @Test - public void association() throws IOException { + void association() throws IOException { String model = "test indentation { var = [0,1,2,3,4]; }"; String expected = "test indentation {\n var=[ 0, 1, 2, 3, 4 ];\n}"; assertFormattedPTC(expected, model); @@ -167,7 +167,7 @@ public void association() throws IOException { * @throws IOException */ @Test - public void indentationAndComments() throws IOException { + void indentationAndComments() throws IOException { String model = "test /* xxx */ indentation { float val; // some float\n double /* oo */ y; indentation { // some block\n int x; // xxx\n } } // final comment"; String expected = "test /* xxx */ indentation {\n float val; // some float\n double /* oo */ y;\n indentation { // some block\n int x; // xxx\n }\n} // final comment"; assertFormattedPTC(expected, model); @@ -183,7 +183,7 @@ public void indentationAndComments() throws IOException { * @throws IOException */ @Test - public void indentationAndLineWrap() throws IOException { + void indentationAndLineWrap() throws IOException { String model = "test indentation { void func(x:int,y:int,s:javalangString, foo:javasqlDate, blupp:mylongtype, msads:adshdjkhsakdasdkslajdlsask, x:x, a:b, c:d ); }"; String expected = "test indentation {\n void func(x:int,y:int,\n\t\ts:javalangString,\n\t\tfoo:javasqlDate,\n\t\tblupp:mylongtype,\n\t\tmsads:adshdjkhsakdasdkslajdlsask,\n\t\tx:x,a:b,c:d);\n}"; assertFormattedPTC(expected, model); @@ -198,7 +198,7 @@ public void indentationAndLineWrap() throws IOException { * @throws IOException */ @Test - public void between1() throws IOException { + void between1() throws IOException { String model = "test indentation { indentation { x x; }; }"; String expected = "test indentation {\n indentation {\n x x;\n };\n}"; assertFormattedPTC(expected, model); @@ -213,7 +213,7 @@ public void between1() throws IOException { * @throws IOException */ @Test - public void between2() throws IOException { + void between2() throws IOException { String model = "test indentation { indentation { x x; } }"; String expected = "test indentation {\n indentation {\n x x;\n }\n}"; assertFormattedPTC(expected, model); @@ -228,7 +228,7 @@ public void between2() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRule() throws IOException { + void linewrapDatatypeRule() throws IOException { String model = "test linewrap fqn ab; fqn xx.yy.zz;"; String expected = "test linewrap\nfqn\nab;\nfqn\nxx.yy.zz;"; assertFormattedPTC(expected, model); @@ -243,7 +243,7 @@ public void linewrapDatatypeRule() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRulePartial1() throws IOException { + void linewrapDatatypeRulePartial1() throws IOException { String model = "test linewrap fqn ab . xx .yy .zz;"; String expected = "test linewrap fqn ab.xx.yy.zz;"; assertFormattedNM(expected, model, 22, 2); @@ -256,7 +256,7 @@ public void linewrapDatatypeRulePartial1() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRulePartial2() throws IOException { + void linewrapDatatypeRulePartial2() throws IOException { String model = "test linewrap fqn ab . xx .yy .zz;fqn xxx;"; String expected = "test linewrap fqn\nab.xx.yy.zz;fqn xxx;"; assertFormattedNM(expected, model, 15, 10); @@ -269,7 +269,7 @@ public void linewrapDatatypeRulePartial2() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRulePartial3() throws IOException { + void linewrapDatatypeRulePartial3() throws IOException { String model = "test linewrap fqn ab . xx .yy .zz;fqn xxx;"; String expected = "test linewrap fqn ab.xx.yy.zz;\nfqn xxx;"; assertFormattedNM(expected, model, 25, 12); @@ -282,7 +282,7 @@ public void linewrapDatatypeRulePartial3() throws IOException { * @throws IOException */ @Test - public void formatSegment1() throws IOException { + void formatSegment1() throws IOException { String model = "test\nindentation {\n indentation { x x ; } }"; String expected = "test\nindentation {\n indentation {\n x x;\n } }"; assertFormattedNM(expected, model, 30, 18); @@ -295,7 +295,7 @@ public void formatSegment1() throws IOException { * @throws IOException */ @Test - public void formatSegment2() throws IOException { + void formatSegment2() throws IOException { String model = "test indentation {\n indentation { x x ; } }"; // String expected = // "test\nindentation {\n indentation {\n x x;\n } }"; @@ -309,7 +309,7 @@ public void formatSegment2() throws IOException { * @throws IOException */ @Test - public void formatSegment3() throws IOException { + void formatSegment3() throws IOException { String model = " test indentation {\n indentation { x x ; } }"; String expected = "test indentation {\n indentation {\n x x;\n }\n}"; assertFormattedNM(expected, model, 0, model.length()); @@ -322,7 +322,7 @@ public void formatSegment3() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRuleRef1() throws IOException { + void linewrapDatatypeRuleRef1() throws IOException { String model = "test linewrap fqn ab .cd .ef; fqnref ab. cd. ef;"; String expected = "test linewrap\nfqn\nab.cd.ef;\nfqnref\nab.cd.ef;"; // assertFormattedPTC(expected, model); @@ -336,7 +336,7 @@ public void linewrapDatatypeRuleRef1() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRuleRef2() throws IOException { + void linewrapDatatypeRuleRef2() throws IOException { String model = "test linewrap fqn ab.cd.ef; fqnref ab.cd.ef;"; String expected = "test linewrap\nfqn\nab.cd.ef;\nfqnref\nab.cd.ef;"; assertFormattedPTC(expected, model); @@ -352,7 +352,7 @@ public void linewrapDatatypeRuleRef2() throws IOException { * @throws IOException */ @Test - public void linewrapDatatypeRuleComments() throws IOException { + void linewrapDatatypeRuleComments() throws IOException { String model = "test linewrap/* 1 */fqn/* 2 */ab.cd.ef/* 3 */;/* 4 */fqnref/* 5 */ab.cd.ef/* 6 */;/* 7 */"; // The expected model string differs from Xtext's - // Xtext does not expect a line wrap after the keyword "linewrap" @@ -371,7 +371,7 @@ public void linewrapDatatypeRuleComments() throws IOException { * @throws IOException */ @Test - public void enumeration() throws IOException { + void enumeration() throws IOException { String model = "test linewrap enum lit1,lit2,lit3,lit1;"; String expected = "test linewrap\nenum lit1 ,\nlit2,\nlit3,\nlit1;"; assertFormattedPTC(expected, model); @@ -387,7 +387,7 @@ public void enumeration() throws IOException { */ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=312559 @Test - public void suppressedWhitespace() throws IOException { + void suppressedWhitespace() throws IOException { String model = "test linewrap `f%%a` post;"; String expected = "test linewrap\n`f%< b >%a` post;"; assertFormattedPTC(expected, model); @@ -419,7 +419,7 @@ public void suppressedLinewrap() throws IOException { * @throws IOException */ @Test - public void linewrapMin() throws IOException { + void linewrapMin() throws IOException { String model = "test wrapminmax foo bar;"; String expected = "test wrapminmax\n\nfoo bar;"; assertFormattedPTC(expected, model); @@ -434,7 +434,7 @@ public void linewrapMin() throws IOException { * @throws IOException */ @Test - public void linewrapMax() throws IOException { + void linewrapMax() throws IOException { String model = "test wrapminmax\n\n\n\n\n\n\n\n\n\n\n\n\nfoo bar;"; String expected = "test wrapminmax\n\n\n\n\nfoo bar;"; assertFormattedPTC(expected, model); @@ -449,7 +449,7 @@ public void linewrapMax() throws IOException { * @throws IOException */ @Test - public void linewrapKeep() throws IOException { + void linewrapKeep() throws IOException { String model = "test wrapminmax\n\n\n\nfoo bar;"; assertFormattedPTC(model, model); assertFormattedNM(model, model, 0, model.length()); @@ -463,7 +463,7 @@ public void linewrapKeep() throws IOException { * @throws IOException */ @Test - public void linewrapDefault() { + void linewrapDefault() { FormatterTestLanguageFactory f = FormatterTestLanguageFactory.eINSTANCE; TestLinewrapMinMax m = f.createTestLinewrapMinMax(); Decl d = f.createDecl(); @@ -482,7 +482,7 @@ public void linewrapDefault() { * @throws IOException */ @Test - public void space() throws IOException { + void space() throws IOException { String model = "test linewrap space foo;"; String expected = "test linewrap\nspace foo;"; assertFormattedPTC(expected, model); @@ -497,7 +497,7 @@ public void space() throws IOException { * @throws IOException */ @Test - public void datatypeRules() throws IOException { + void datatypeRules() throws IOException { String model = "test linewrap datatypes abc kw1 bcd def kw3;"; String expected = "test linewrap\ndatatypes abc\nkw1\nbcd\ndef\nkw3;"; assertFormattedPTC(expected, model); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/AbstractFragmentProviderTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/AbstractFragmentProviderTest.java index 58f1f104d2..2a2ac3c3b1 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/AbstractFragmentProviderTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/AbstractFragmentProviderTest.java @@ -20,7 +20,7 @@ * Tests for {@code AbstractFragmentProvider}. */ @SuppressWarnings("nls") -public class AbstractFragmentProviderTest { +class AbstractFragmentProviderTest { private static final String[] SPECIAL_ESCAPE_CASES = new String[] {"\\", "\\\\", "\\\\\\", "\\#", "\\\\#", "\\\\\\#", "#", "##", "#\\"}; @@ -54,19 +54,19 @@ public String unescape(final String text) { private final TestAbstractFragmentProvider fragmentProvider = new TestAbstractFragmentProvider(); @Test - public void testEscape() { + void testEscape() { StringBuilder builder = new StringBuilder(); fragmentProvider.appendEscaped("foo/bar#\\", builder); assertEquals(builder.toString(), "foo\\/bar#\\\\", "Fragment not properly scaped"); } @Test - public void testUnescape() { + void testUnescape() { assertEquals("foo//bar##\\", fragmentProvider.unescape("foo\\/\\/bar##\\\\"), "Fragment not properly unscaped"); } @Test - public void testUnescapeEscape() { + void testUnescapeEscape() { for (String text : SPECIAL_ESCAPE_CASES) { StringBuilder builder = new StringBuilder(); fragmentProvider.appendEscaped(text, builder); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/ShortFragmentProviderTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/ShortFragmentProviderTest.java index 1bca473ece..d7db874cc4 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/ShortFragmentProviderTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/linking/ShortFragmentProviderTest.java @@ -35,7 +35,7 @@ */ @SuppressWarnings("nls") @TestInstance(Lifecycle.PER_CLASS) -public class ShortFragmentProviderTest { +class ShortFragmentProviderTest { private static final String FRAGMENT_MUST_BE_EQUAL = "Fragment must be equal"; private static AbstractTestUtil testUtil = new AbstractTestUtil() { @@ -63,7 +63,7 @@ public EObject getEObject(final String fragment) { private EReference testReference2; @BeforeEach - public void initialize() { + void initialize() { EcoreFactory ecoreFactory = EcoreFactory.eINSTANCE; testClass = ecoreFactory.createEClass(); @@ -85,7 +85,7 @@ public void initialize() { } @AfterEach - public void cleanup() { + void cleanup() { EPackage.Registry.INSTANCE.remove(testPackage.getNsURI()); } @@ -110,7 +110,7 @@ public void testLongFragment() { } @Test - public void testLongFragment2() { + void testLongFragment2() { int reps = 10; EObject root = EcoreUtil.create(testClass); EObject parent = root; diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNamePatternTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNamePatternTest.java index 56c20b5354..f72bee65ea 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNamePatternTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNamePatternTest.java @@ -28,10 +28,10 @@ @SuppressWarnings({"PMD.JUnitAssertionsShouldIncludeMessage", "nls"}) @ExtendWith(InjectionExtension.class) // CHECKSTYLE:CONSTANTS-OFF -public class QualifiedNamePatternTest { +class QualifiedNamePatternTest { @Test - public void testSimpleQualifiedNamePattern() { + void testSimpleQualifiedNamePattern() { QualifiedNamePattern pattern = QualifiedNamePattern.create("foo*"); assertEquals(QualifiedName.create("foo"), pattern.lowerInclusive()); assertEquals(QualifiedName.create("fop"), pattern.upperExclusive()); @@ -41,7 +41,7 @@ public void testSimpleQualifiedNamePattern() { } @Test - public void testQualifiedPrefixNamePattern() { + void testQualifiedPrefixNamePattern() { QualifiedNamePattern pattern = QualifiedNamePattern.create("foo", "*"); assertEquals(QualifiedName.create("foo", ""), pattern.lowerInclusive()); assertEquals(QualifiedName.create("foo!"), pattern.upperExclusive()); @@ -55,7 +55,7 @@ public void testQualifiedPrefixNamePattern() { } @Test - public void testRecursiveWildcardPattern() { + void testRecursiveWildcardPattern() { QualifiedNamePattern pattern = QualifiedNamePattern.create("foo", "**"); assertEquals(QualifiedName.create("foo", ""), pattern.lowerInclusive()); assertEquals(QualifiedName.create("foo!"), pattern.upperExclusive()); @@ -65,7 +65,7 @@ public void testRecursiveWildcardPattern() { } @Test - public void testRecursiveWildcardPatternWithPrefix() { + void testRecursiveWildcardPatternWithPrefix() { QualifiedNamePattern pattern = QualifiedNamePattern.create("foo", "b**"); assertEquals(QualifiedName.create("foo", "b"), pattern.lowerInclusive()); assertEquals(QualifiedName.create("foo", "c"), pattern.upperExclusive()); @@ -75,36 +75,36 @@ public void testRecursiveWildcardPatternWithPrefix() { } @Test - public void testRecursiveWildcardPatternError() { + void testRecursiveWildcardPatternError() { assertThrows(IllegalArgumentException.class, () -> QualifiedNamePattern.create("foo", "bar**baz")); } @Test - public void testRecursiveWildcardPatternError2() { + void testRecursiveWildcardPatternError2() { assertThrows(IllegalArgumentException.class, () -> QualifiedNamePattern.create("foo", "**", "bar")); } @Test - public void testRecursiveWildcardPatternError3() { + void testRecursiveWildcardPatternError3() { assertThrows(IllegalArgumentException.class, () -> QualifiedNamePattern.create("foo*bar")); } @Test - public void testAllPattern() { + void testAllPattern() { QualifiedNamePattern pattern = QualifiedNamePattern.create("*"); assertEquals(QualifiedName.create(""), pattern.lowerInclusive()); assertEquals(QualifiedName.create("!"), pattern.upperExclusive()); } @Test - public void testPatternWithoutWildcard() { + void testPatternWithoutWildcard() { QualifiedNamePattern pattern = QualifiedNamePattern.create("foo"); assertEquals(QualifiedName.create("foo"), pattern.lowerInclusive()); assertEquals(QualifiedName.create("foo!"), pattern.upperExclusive()); } @Test - public void testRegexpPatterns() { + void testRegexpPatterns() { QualifiedNamePattern pattern = QualifiedNamePattern.createFromGlobs("*"); assertEquals(QualifiedName.create(""), pattern.lowerInclusive()); assertEquals(QualifiedName.create("!"), pattern.upperExclusive()); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNameSegmentTreeLookupTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNameSegmentTreeLookupTest.java index 5490343e01..872cbd6550 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNameSegmentTreeLookupTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/naming/QualifiedNameSegmentTreeLookupTest.java @@ -33,18 +33,18 @@ @SuppressWarnings({"nls", "unused", "PMD.JUnitAssertionsShouldIncludeMessage"}) // CHECKSTYLE:CHECK-OFF MultipleStringLiteralsCheck -public class QualifiedNameSegmentTreeLookupTest { +class QualifiedNameSegmentTreeLookupTest { private static final Logger LOGGER = LogManager.getLogger(QualifiedNameSegmentTreeLookupTest.class); private final QualifiedNameSegmentTreeLookup lookup = new QualifiedNameSegmentTreeLookup(URI.class, true); @Test - public void testEmpty() { + void testEmpty() { assertNull(lookup.get(QualifiedName.EMPTY)); } @Test - public void testExact() { + void testExact() { QualifiedName name = name("foo"); Collection values = Collections.singletonList(uri(name)); lookup.putAll(name, values); @@ -62,7 +62,7 @@ public void testExact() { } @Test - public void testTopLevelPatternWithoutWildcard() { + void testTopLevelPatternWithoutWildcard() { URI value1 = put("foo"); URI value2 = put("bar"); URI value3 = put("foo2"); @@ -73,7 +73,7 @@ public void testTopLevelPatternWithoutWildcard() { } @Test - public void testTopLevelPatternWithWildcard() { + void testTopLevelPatternWithWildcard() { URI value1 = put("foo"); URI value2 = put("foo2"); URI value3 = put("bar"); @@ -84,7 +84,7 @@ public void testTopLevelPatternWithWildcard() { } @Test - public void testNestedPatternMatchesWithoutWildcard() { + void testNestedPatternMatchesWithoutWildcard() { URI value1 = put("foo"); URI value2 = put("foo.bar"); URI value3 = put("foo2"); @@ -95,7 +95,7 @@ public void testNestedPatternMatchesWithoutWildcard() { } @Test - public void testNestedPatternMatchesWithWildcard() { + void testNestedPatternMatchesWithWildcard() { URI value1 = put("foo"); URI value2 = put("foo.bar"); URI value3 = put("foo.baz"); @@ -109,7 +109,7 @@ public void testNestedPatternMatchesWithWildcard() { } @Test - public void testNestedPatternMatchesWithRecursiveWildcard() { + void testNestedPatternMatchesWithRecursiveWildcard() { URI value1 = put("foo"); URI value2 = put("foo.bar"); URI value3 = put("foo.bar.baz"); @@ -122,7 +122,7 @@ public void testNestedPatternMatchesWithRecursiveWildcard() { } @Test - public void testUnmatchedNestedPattern() { + void testUnmatchedNestedPattern() { URI value1 = put("foo"); URI value2 = put("foo.bar"); URI value3 = put("foo.bar.baz"); @@ -141,7 +141,7 @@ public void testUnmatchedNestedPattern() { } @Test - public void testOutOfOrderInsertion() { + void testOutOfOrderInsertion() { QualifiedName name1 = name("foo.bar"); Collection value1 = Collections.singletonList(uri(name1)); lookup.putAll(name1, value1); @@ -154,7 +154,7 @@ public void testOutOfOrderInsertion() { } @Test - public void testLoadStore() throws IOException, ClassNotFoundException { + void testLoadStore() throws IOException, ClassNotFoundException { List nameList = List.of(name("foo"), name("foo.bar"), name("bar")); for (QualifiedName qn : nameList) { lookup.put(qn, uri(qn)); @@ -178,7 +178,7 @@ public void testLoadStore() throws IOException, ClassNotFoundException { } @Test - public void testGetMappings() { + void testGetMappings() { final QualifiedName a = name("A"); final QualifiedName b = name("B"); final QualifiedName c = name("A.C"); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/AbstractSelectorFragmentProviderTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/AbstractSelectorFragmentProviderTest.java index 625c3eb828..1e85eaaf71 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/AbstractSelectorFragmentProviderTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/AbstractSelectorFragmentProviderTest.java @@ -39,32 +39,32 @@ @SuppressWarnings({"PMD.JUnitAssertionsShouldIncludeMessage", "nls"}) @InjectWith(AbstractXtextTestsInjectorProvider.class) @ExtendWith(InjectionExtension.class) -public class AbstractSelectorFragmentProviderTest { +class AbstractSelectorFragmentProviderTest { // CHECKSTYLE:ON @Inject private ParseHelper parseHelper; @Test - public void testTopLevelObject() { + void testTopLevelObject() { Grammar grammar = (Grammar) getModel("grammar foo.Foo\n" + "generate foo 'http://www.foo.com/foo'\n" + "Foo: 'foo';"); assertFragmentMatchesAndResolves(grammar.eResource(), "/0", grammar); } @Test - public void testMultiValuedContainment() { + void testMultiValuedContainment() { Grammar grammar = (Grammar) getModel("grammar foo.Foo\n" + "generate foo 'http://www.foo.com/foo'\n" + "Foo: 'foo';"); assertFragmentMatchesAndResolves(grammar.eResource(), "/0/5(0='Foo')#0", grammar.getRules().get(0)); } @Test - public void testSingleValuedContainment() { + void testSingleValuedContainment() { Grammar grammar = (Grammar) getModel("grammar foo.Foo\n" + "generate foo 'http://www.foo.com/foo'\n" + "Foo: 'foo'+;"); assertFragmentMatchesAndResolves(grammar.eResource(), "/0/5(0='Foo')#0/2(3='foo')", grammar.getRules().get(0).getAlternatives()); } @Test - public void testNullSelectorValue() { + void testNullSelectorValue() { Grammar grammar = (Grammar) getModel("grammar foo.Foo\n" + "generate foo 'http://www.foo.com/foo'\n" + "Foo: 'selectCardinality';"); assertFragmentMatchesAndResolves(grammar.eResource(), "/0/5(0='Foo')#0/2(0=null)", grammar.getRules().get(0).getAlternatives()); @@ -73,7 +73,7 @@ public void testNullSelectorValue() { } @Test - public void testEscapedSelectorValue() { + void testEscapedSelectorValue() { Grammar grammar = (Grammar) getModel("grammar foo.Foo\n" + "generate foo 'http://www.foo.com/foo'\n" + "Foo: 'foo.bar#';"); assertFragmentMatchesAndResolves(grammar.eResource(), "/0/5(0='Foo')#0/2(3='foo.bar#')", grammar.getRules().get(0).getAlternatives()); } diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/BugAig1084.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/BugAig1084.java index a2d550034f..794527974e 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/BugAig1084.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/BugAig1084.java @@ -24,14 +24,14 @@ import com.google.common.collect.Lists; -public class BugAig1084 { +class BugAig1084 { /** * Test that recursive calls to {@link ResourceDescription2#getLookUp()} by {@link ResourceDescription2#computeExportedObjects()} do not cause * stack-overflow. */ @Test - public void recursiveLookUp() { + void recursiveLookUp() { Resource resource = org.mockito.Mockito.mock(Resource.class); EList emptyEList = new BasicEList(); org.mockito.Mockito.when(resource.eAdapters()).thenReturn(emptyEList); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/ResourceDescriptionDeltaTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/ResourceDescriptionDeltaTest.java index e60dca7862..5c9cf5e486 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/ResourceDescriptionDeltaTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/ResourceDescriptionDeltaTest.java @@ -34,10 +34,10 @@ @SuppressWarnings({"PMD.JUnitAssertionsShouldIncludeMessage", "nls"}) -public class ResourceDescriptionDeltaTest { +class ResourceDescriptionDeltaTest { @Test - public void testGetAddedAndDeletedObjects() { + void testGetAddedAndDeletedObjects() { ResourceDescriptionDelta delta = new ResourceDescriptionDelta(createDescription("a"), createDescription("a"), null); assertDeltaEquals(0, 0, 0, delta); @@ -58,7 +58,7 @@ public void testGetAddedAndDeletedObjects() { } @Test - public void testGetChangedObjects() { + void testGetChangedObjects() { ResourceDescriptionDelta delta = new ResourceDescriptionDelta(createDescription("a:a"), createDescription("a:a1"), null); assertDeltaEquals(0, 1, 0, delta); @@ -70,19 +70,19 @@ public void testGetChangedObjects() { } @Test - public void testDeltaForNewResource() { + void testDeltaForNewResource() { ResourceDescriptionDelta delta = new ResourceDescriptionDelta(null, createDescription("a"), null); assertDeltaEquals(1, 0, 0, delta); } @Test - public void testDeltaForDeletedResource() { + void testDeltaForDeletedResource() { ResourceDescriptionDelta delta = new ResourceDescriptionDelta(createDescription("a"), null, null); assertDeltaEquals(0, 0, 1, delta); } @Test - public void testOldReconstruction() { + void testOldReconstruction() { IResourceDescription oldRes = createDescription("a"); ResourceDescriptionDelta delta = new ResourceDescriptionDelta(oldRes, createDescription("a"), null); diff --git a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/util/RuntimeProjectUtilTest.java b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/util/RuntimeProjectUtilTest.java index 58d1374632..5331e1c13e 100644 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/util/RuntimeProjectUtilTest.java +++ b/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/util/RuntimeProjectUtilTest.java @@ -40,7 +40,7 @@ * A test class for {@link RuntimeProjectUtil} */ @SuppressWarnings("nls") -public class RuntimeProjectUtilTest extends AbstractUtilTest { +class RuntimeProjectUtilTest extends AbstractUtilTest { private static final String WORKSPACE_PATH = ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath(); @@ -84,7 +84,7 @@ protected void beforeAllTests() { * Tests extracting project path from a {@link Resource}. */ @Test - public void getPathProjectTest() { + void getPathProjectTest() { assertEquals(WORKSPACE_PATH + "/" + TEST_PROJECT_NAME, RuntimeProjectUtil.getPathProject(resource, mapperCorrect), "Check if the correct project path has been returned"); } @@ -93,7 +93,7 @@ public void getPathProjectTest() { * Tests extracting project name from a {@link URI}. */ @Test - public void getProjectCorrectTest() { + void getProjectCorrectTest() { super.addSourceToWorkspace(SOURCE_NAMES.get(0)); IProject iproject = RuntimeProjectUtil.getProject(uriCorrect, mapperCorrect); assumeTrue(iproject != null); @@ -104,7 +104,7 @@ public void getProjectCorrectTest() { * Checks when passed {@link IStorage2UriMapper} is broken then null instead of project name expected. */ @Test - public void getProjectInCorrectTest() { + void getProjectInCorrectTest() { super.addSourceToWorkspace(SOURCE_NAMES.get(0)); IProject iproject = RuntimeProjectUtil.getProject(uriCorrect, mapperInCorrect); assertNull(iproject, "When passed IStorage2UriMapper is broken then null instead of project name expected"); @@ -115,7 +115,7 @@ public void getProjectInCorrectTest() { * Tests correct delegation of responsibility to the {@link IStorage2UriMapper}. */ @Test - public void findFileStorageCorrectTest() { + void findFileStorageCorrectTest() { super.addSourceToWorkspace(SOURCE_NAMES.get(0)); assertEquals(RuntimeProjectUtil.findFileStorage(uriCorrect, mapperCorrect), file, "Check if the correct file has been returned"); } @@ -124,7 +124,7 @@ public void findFileStorageCorrectTest() { * Checks when passed {@link IStorage2UriMapper} is broken then no file expected. */ @Test - public void findFileStorageInCorrectTest() { + void findFileStorageInCorrectTest() { assertNull(RuntimeProjectUtil.findFileStorage(uriInCorrect, mapperInCorrect), "When passed IStorage2UriMapper is broken then no file expected"); } diff --git a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorRunTest.java b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorRunTest.java index f49cd0e81e..0cab33eabd 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorRunTest.java +++ b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorRunTest.java @@ -56,7 +56,7 @@ import com.google.inject.name.Names; -public class WorkbenchResolutionAdaptorRunTest { +class WorkbenchResolutionAdaptorRunTest { private static final String TEST_FILE_NAME = "TestFileName"; //$NON-NLS-1$ diff --git a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorTest.java b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorTest.java index eff10ff59f..074bf7eae2 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorTest.java +++ b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/quickfix/WorkbenchResolutionAdaptorTest.java @@ -27,7 +27,7 @@ import com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchMarkerResolutionGenerator.WorkbenchResolutionAdapter; -public class WorkbenchResolutionAdaptorTest { +class WorkbenchResolutionAdaptorTest { private static final String TEST_LABEL = "ATestLabel"; //$NON-NLS-1$ private static final String TEST_DESCRIPTION = "ATestDescription"; //$NON-NLS-1$ diff --git a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/ResourceNameTemplateVariableResolverTest.java b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/ResourceNameTemplateVariableResolverTest.java index 22aced3f95..fee1706fab 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/ResourceNameTemplateVariableResolverTest.java +++ b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/ResourceNameTemplateVariableResolverTest.java @@ -34,7 +34,7 @@ @ExtendWith(InjectionExtension.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -public class ResourceNameTemplateVariableResolverTest { +class ResourceNameTemplateVariableResolverTest { private static final Object[] FILE = new Object[] {"file"}; //$NON-NLS-1$ private static final String FILENAME = "filename"; //$NON-NLS-1$ diff --git a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/SimpleEnumTemplateVariableResolverTest.java b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/SimpleEnumTemplateVariableResolverTest.java index 6489c544fe..c37a88e1b7 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/SimpleEnumTemplateVariableResolverTest.java +++ b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/SimpleEnumTemplateVariableResolverTest.java @@ -33,7 +33,7 @@ @ExtendWith(InjectionExtension.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -public class SimpleEnumTemplateVariableResolverTest { +class SimpleEnumTemplateVariableResolverTest { private static XtextTemplateContext mockContext; private static TemplateVariableResolverTestHelper helper; diff --git a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/TemplateProposalProviderHelperTest.xtend b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/TemplateProposalProviderHelperTest.xtend index dd2add1d7c..b0d122fe90 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/TemplateProposalProviderHelperTest.xtend +++ b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/templates/TemplateProposalProviderHelperTest.xtend @@ -37,7 +37,7 @@ import org.junit.jupiter.api.AfterAll @ExtendWith(InjectionExtension) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class TemplateProposalProviderHelperTest { +package class TemplateProposalProviderHelperTest { static val SIMPLE_ENUM_VARIABLE_TYPE = new SimpleEnumTemplateVariableResolver().type static val VARIABLE_NAME = "variableName" diff --git a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/test/XtextUiTestSuite.java b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/test/XtextUiTestSuite.java index 76fcf67a18..9a2ecd18e6 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/test/XtextUiTestSuite.java +++ b/com.avaloq.tools.ddk.xtext.ui.test/src/com/avaloq/tools/ddk/xtext/ui/test/XtextUiTestSuite.java @@ -11,28 +11,19 @@ package com.avaloq.tools.ddk.xtext.ui.test; -import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -import com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchResolutionAdaptorRunTest; -import com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchResolutionAdaptorTest; -import com.avaloq.tools.ddk.xtext.ui.templates.ResourceNameTemplateVariableResolverTest; -import com.avaloq.tools.ddk.xtext.ui.templates.SimpleEnumTemplateVariableResolverTest; -import com.avaloq.tools.ddk.xtext.ui.templates.TemplateProposalProviderHelperTest; - /** * Junit5 version of test suites. does not implement the logic in our DiscerningSuite. */ @Suite -@SelectClasses({ +@SelectPackages({ // @Format-Off - WorkbenchResolutionAdaptorRunTest.class, - WorkbenchResolutionAdaptorTest.class, - TemplateProposalProviderHelperTest.class, - ResourceNameTemplateVariableResolverTest.class, - SimpleEnumTemplateVariableResolverTest.class + "com.avaloq.tools.ddk.xtext.ui.quickfix", + "com.avaloq.tools.ddk.xtext.ui.templates" // @Format-On }) -public class XtextUiTestSuite { +class XtextUiTestSuite { } diff --git a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractFingerprintComputer.java b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractFingerprintComputer.java index c9a7ae98c2..048fe85cc7 100644 --- a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractFingerprintComputer.java +++ b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractFingerprintComputer.java @@ -516,7 +516,6 @@ protected ExportItem fingerprintRef(final EObject obj, final EReference ref, fin * the URIs or by calling a generated function, must not be {@code null} * @return the fingerprint */ - @SuppressWarnings("unchecked") protected ExportItem fingerprintExpr(final Object obj, final EObject context, final FingerprintOrder order, final FingerprintIndirection indirection) { if (obj instanceof EObject) { if (indirection == FingerprintIndirection.INDIRECT) { diff --git a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractStreamingFingerprintComputer.java b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractStreamingFingerprintComputer.java index fa69529426..bf9223d127 100644 --- a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractStreamingFingerprintComputer.java +++ b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractStreamingFingerprintComputer.java @@ -456,7 +456,6 @@ protected void fingerprintRef(final EObject obj, final EReference ref, final Fin * @param hasher * hasher to stream to */ - @SuppressWarnings("unchecked") protected void fingerprintExpr(final Object obj, final EObject context, final FingerprintOrder order, final FingerprintIndirection indirection, final Hasher hasher) { if (obj instanceof EObject) { if (indirection == FingerprintIndirection.INDIRECT) { diff --git a/ddk-configuration/pmd/ruleset.xml b/ddk-configuration/pmd/ruleset.xml index cca425c723..64bc550504 100644 --- a/ddk-configuration/pmd/ruleset.xml +++ b/ddk-configuration/pmd/ruleset.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + name="Tools PMD ruleset" + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> Avaloq Tools PMD ruleset @@ -13,128 +13,136 @@ .*/ddk/xtext/test/ui/quickfix/AbstractQuickFixTest.* - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + \ No newline at end of file diff --git a/scripts/fix_junit5_visibility.py b/scripts/fix_junit5_visibility.py new file mode 100644 index 0000000000..4c92d5013b --- /dev/null +++ b/scripts/fix_junit5_visibility.py @@ -0,0 +1,354 @@ +#!/usr/bin/env python3 +""" +Script to fix JUnit 5 test visibility issues. +- Converts @SelectClasses to @SelectPackages in test suites +- Makes test classes package-private +- Makes test methods (@Test, @BeforeEach, @AfterEach, etc.) package-private +""" + +import os +import re +from pathlib import Path +from typing import List, Tuple, Set + +# Root directory of the project +PROJECT_ROOT = Path(r"c:\dev\dsl-devkit") + +# Test source directories pattern +TEST_SRC_PATTERN = "*test*/**/src/**/*.java" + +# JUnit 5 test annotations that indicate test methods +TEST_ANNOTATIONS = { + "@Test", + "@BeforeEach", + "@AfterEach", + "@BeforeAll", + "@AfterAll", + "@ParameterizedTest", + "@RepeatedTest", + "@TestFactory", + "@TestTemplate", +} + +# Lifecycle annotations for Xtend files +XTEND_TEST_ANNOTATIONS = { + "@Test", + "@BeforeAll", + "@AfterAll", +} + + +def find_test_files(root: Path) -> List[Path]: + """Find all Java test files in the project.""" + test_files = [] + for test_dir in root.glob("com.avaloq.tools.ddk.*/src"): + if "test" in str(test_dir.parent.name).lower(): + for java_file in test_dir.rglob("*.java"): + test_files.append(java_file) + return test_files + + +def find_xtend_test_files(root: Path) -> List[Path]: + """Find all Xtend test files in the project.""" + test_files = [] + for test_dir in root.glob("com.avaloq.tools.ddk.*/src"): + if "test" in str(test_dir.parent.name).lower(): + for xtend_file in test_dir.rglob("*.xtend"): + test_files.append(xtend_file) + return test_files + + +def is_test_class(content: str) -> bool: + """Check if the file contains JUnit 5 test annotations.""" + for annotation in TEST_ANNOTATIONS: + if annotation in content: + return True + return False + + +def is_suite_class(content: str) -> bool: + """Check if the file is a JUnit 5 suite.""" + return "@Suite" in content + + +def extract_packages_from_select_classes(content: str) -> Set[str]: + """Extract package names from @SelectClasses imports.""" + packages = set() + # Find all imports of test classes + import_pattern = r"import\s+([\w.]+)\.\w+;" + for match in re.finditer(import_pattern, content): + package = match.group(1) + # Only include test-related packages + if any(x in package for x in ["test", "Test"]): + packages.add(package) + return packages + + +def make_class_package_private(content: str) -> str: + """Convert public class declarations to package-private.""" + # Match: public class ClassName or public class ClassName extends/implements + # But not: public static class (inner classes) + pattern = r"^(\s*)public\s+(class\s+\w+)" + replacement = r"\1\2" + return re.sub(pattern, replacement, content, flags=re.MULTILINE) + + +def make_test_methods_package_private(content: str) -> str: + """Convert public test methods to package-private.""" + lines = content.split("\n") + result = [] + i = 0 + while i < len(lines): + line = lines[i] + # Check if this line has a test annotation + has_test_annotation = any(ann in line for ann in TEST_ANNOTATIONS) + + if has_test_annotation: + result.append(line) + i += 1 + # Look at next non-empty, non-annotation lines for method signature + while i < len(lines): + next_line = lines[i] + # Skip empty lines and additional annotations + if next_line.strip() == "" or next_line.strip().startswith("@"): + result.append(next_line) + i += 1 + continue + # Check if this is a public method declaration + if re.match(r"\s*public\s+(void|[\w<>\[\]]+)\s+\w+\s*\(", next_line): + # Remove 'public ' from the method + next_line = re.sub(r"^(\s*)public\s+", r"\1", next_line) + result.append(next_line) + i += 1 + break + else: + result.append(line) + i += 1 + + return "\n".join(result) + + +def convert_suite_to_select_packages(content: str, file_path: Path) -> Tuple[str, bool]: + """Convert a suite using @SelectClasses to use @SelectPackages.""" + if "@SelectClasses" not in content: + return content, False + + # Extract packages from the imports + packages = extract_packages_from_select_classes(content) + + if not packages: + print(f" Warning: Could not extract packages from {file_path}") + return content, False + + # Remove the test class imports (keep other imports) + lines = content.split("\n") + new_lines = [] + imports_to_remove = set() + + # First pass: identify imports to remove + select_classes_pattern = r"@SelectClasses\s*\(\s*\{([^}]+)\}" + match = re.search(select_classes_pattern, content, re.DOTALL) + if match: + classes_block = match.group(1) + # Extract class names from the block + class_names = re.findall(r"(\w+)\.class", classes_block) + for class_name in class_names: + # Find the import for this class + import_pattern = rf"import\s+([\w.]+\.{class_name});" + import_match = re.search(import_pattern, content) + if import_match: + imports_to_remove.add(import_match.group(0)) + + # Second pass: rebuild content without those imports + for line in lines: + if line.strip() in imports_to_remove or any( + imp in line for imp in imports_to_remove + ): + continue + new_lines.append(line) + + content = "\n".join(new_lines) + + # Replace @SelectClasses import with @SelectPackages + content = content.replace( + "import org.junit.platform.suite.api.SelectClasses;", + "import org.junit.platform.suite.api.SelectPackages;", + ) + + # Build the @SelectPackages annotation + packages_str = ",\n ".join(f'"{pkg}"' for pkg in sorted(packages)) + select_packages_annotation = f"@SelectPackages({{\n {packages_str}\n}})" + + # Replace @SelectClasses({...}) with @SelectPackages({...}) + content = re.sub( + r"@SelectClasses\s*\(\s*\{[^}]+\}\s*\)", + select_packages_annotation, + content, + flags=re.DOTALL, + ) + + # Make the suite class package-private + content = make_class_package_private(content) + + return content, True + + +def process_test_class(file_path: Path) -> bool: + """Process a single test class file.""" + try: + with open(file_path, "r", encoding="utf-8") as f: + original_content = f.read() + except Exception as e: + print(f" Error reading {file_path}: {e}") + return False + + if not is_test_class(original_content): + return False + + content = original_content + + # Make class package-private + content = make_class_package_private(content) + + # Make test methods package-private + content = make_test_methods_package_private(content) + + if content != original_content: + try: + with open(file_path, "w", encoding="utf-8") as f: + f.write(content) + return True + except Exception as e: + print(f" Error writing {file_path}: {e}") + return False + + return False + + +def process_suite_class(file_path: Path) -> bool: + """Process a single suite class file.""" + try: + with open(file_path, "r", encoding="utf-8") as f: + original_content = f.read() + except Exception as e: + print(f" Error reading {file_path}: {e}") + return False + + if not is_suite_class(original_content): + return False + + content, changed = convert_suite_to_select_packages(original_content, file_path) + + if changed and content != original_content: + try: + with open(file_path, "w", encoding="utf-8") as f: + f.write(content) + return True + except Exception as e: + print(f" Error writing {file_path}: {e}") + return False + + return False + + +def make_xtend_class_package_private(content: str) -> str: + """Convert public class declarations to package-private in Xtend files.""" + # In Xtend, 'class' without modifier is package-private + # We need to add 'package' keyword before 'class' + pattern = r"^(\s*)class\s+(\w+)" + + # Check if it's already package or has other modifier + if re.search( + r"^\s*(public|private|protected|package)\s+class", content, re.MULTILINE + ): + # Replace 'public class' with 'package class' + content = re.sub( + r"^(\s*)public\s+class", r"\1package class", content, flags=re.MULTILINE + ) + + return content + + +def process_xtend_test_class(file_path: Path) -> bool: + """Process a single Xtend test class file.""" + try: + with open(file_path, "r", encoding="utf-8") as f: + original_content = f.read() + except Exception as e: + print(f" Error reading {file_path}: {e}") + return False + + # Check if it has test annotations + has_tests = any(ann in original_content for ann in XTEND_TEST_ANNOTATIONS) + if not has_tests: + return False + + content = make_xtend_class_package_private(original_content) + + if content != original_content: + try: + with open(file_path, "w", encoding="utf-8") as f: + f.write(content) + return True + except Exception as e: + print(f" Error writing {file_path}: {e}") + return False + + return False + + +def main(): + print("=" * 60) + print("JUnit 5 Visibility Fixer") + print("=" * 60) + + # Find all test files + print("\nFinding test files...") + java_files = find_test_files(PROJECT_ROOT) + xtend_files = find_xtend_test_files(PROJECT_ROOT) + print(f"Found {len(java_files)} Java test files") + print(f"Found {len(xtend_files)} Xtend test files") + + # Process suite classes first + print("\n" + "-" * 60) + print("Processing Suite classes (converting @SelectClasses to @SelectPackages)...") + print("-" * 60) + suites_modified = 0 + for file_path in java_files: + if process_suite_class(file_path): + print(f" Modified suite: {file_path.relative_to(PROJECT_ROOT)}") + suites_modified += 1 + print(f"Modified {suites_modified} suite files") + + # Process test classes + print("\n" + "-" * 60) + print("Processing Test classes (making package-private)...") + print("-" * 60) + tests_modified = 0 + for file_path in java_files: + if process_test_class(file_path): + print(f" Modified: {file_path.relative_to(PROJECT_ROOT)}") + tests_modified += 1 + print(f"Modified {tests_modified} Java test files") + + # Process Xtend test classes + print("\n" + "-" * 60) + print("Processing Xtend Test classes (making package-private)...") + print("-" * 60) + xtend_modified = 0 + for file_path in xtend_files: + if process_xtend_test_class(file_path): + print(f" Modified: {file_path.relative_to(PROJECT_ROOT)}") + xtend_modified += 1 + print(f"Modified {xtend_modified} Xtend test files") + + print("\n" + "=" * 60) + print("Summary:") + print(f" Suites converted: {suites_modified}") + print(f" Java tests fixed: {tests_modified}") + print(f" Xtend tests fixed: {xtend_modified}") + print("=" * 60) + + +if __name__ == "__main__": + main()