From 55c6f386e93bdfeb68ab2adea82e592baff35e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Thu, 5 Feb 2026 00:28:29 +0100 Subject: [PATCH 01/15] ci: run PMD and Checkstyle in parallel with Maven Replace GitHub Action PMD with Maven-based PMD job for version consistency with ddk-parent/pom.xml. Add separate Checkstyle job. Both run in parallel with maven-verify for faster feedback on style violations. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/verify.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index a06dd8678..0df1256cd 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -12,16 +12,22 @@ jobs: with: distribution: 'temurin' java-version: '21' - - name: PMD - uses: pmd/pmd-github-action@v2.0.0 - id: pmd + - name: Set up Workspace Environment Variable + run: echo "WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV + - name: PMD Check + run: mvn pmd:pmd pmd:cpd pmd:check pmd:cpd-check -f ./ddk-parent/pom.xml --batch-mode --fail-at-end + checkstyle: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-java@v5 with: - version: '7.21.0' - rulesets: 'ddk-configuration/pmd/ruleset.xml' - analyzeModifiedFilesOnly: false - - name: Fail build if there are violations - if: steps.pmd.outputs.violations != 0 - run: exit 1 + distribution: 'temurin' + java-version: '21' + - name: Set up Workspace Environment Variable + run: echo "WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV + - name: Checkstyle Check + run: mvn checkstyle:checkstyle checkstyle:check -f ./ddk-parent/pom.xml --batch-mode --fail-at-end maven-verify: runs-on: ubuntu-24.04 steps: @@ -36,10 +42,10 @@ jobs: distribution: 'temurin' java-version: '21' - name: Set up Workspace Enviroment Variable - run: echo "WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV + run: echo "WORKSPACE=${{ github.workspace }}" >> $GITHUB_ENV - name: Cache Maven dependencies uses: actions/cache@v5 - with: + with: path: /home/runner/.m2/repository key: ${{ runner.os }}-maven-0-${{ hashFiles('**/pom.xml') }} - name: Build with Maven within a virtual X Server Environment From ff7f4033f5d746c41ec6916d5417cf199419e78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Thu, 5 Feb 2026 18:51:51 +0100 Subject: [PATCH 02/15] fix: add explicit cast to satisfy PMD CollectionTypeMismatch rule The cast clarifies that ProxyModelAssociationsAdapter is an Adapter through its inheritance chain. Co-Authored-By: Claude Opus 4.5 --- .../resource/persistence/ProxyModelAssociationsAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/persistence/ProxyModelAssociationsAdapter.java b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/persistence/ProxyModelAssociationsAdapter.java index 54d37e9fa..e4dcca1ae 100644 --- a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/persistence/ProxyModelAssociationsAdapter.java +++ b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/persistence/ProxyModelAssociationsAdapter.java @@ -67,7 +67,7 @@ private void ensureAssociationsLoaded() { return; } synchronized (resource) { - if (resource.eAdapters().remove(this)) { + if (resource.eAdapters().remove((org.eclipse.emf.common.notify.Adapter) this)) { DirectLinkingResourceStorageLoadable loadable = (DirectLinkingResourceStorageLoadable) ((DirectLinkingResourceStorageFacade) resource.getResourceStorageFacade()).getOrCreateResourceStorageLoadable(resource); try { // the associations are mappings from AST model elements to inferred model elements (and back) so we cannot skip loading the model. From 144cce4dc5ebdd0e3080ac92e78fe35957eec0f4 Mon Sep 17 00:00:00 2001 From: Joao Ferreira Date: Tue, 27 Jan 2026 08:32:14 +0100 Subject: [PATCH 03/15] chore: initial JUnit 5 migration setup --- .../WorkbenchResolutionAdaptorRunTest.java | 2 +- .../WorkbenchResolutionAdaptorTest.java | 2 +- ...ourceNameTemplateVariableResolverTest.java | 2 +- ...impleEnumTemplateVariableResolverTest.java | 2 +- .../TemplateProposalProviderHelperTest.xtend | 2 +- .../ddk/xtext/ui/test/XtextUiTestSuite.java | 19 +- ddk-configuration/pmd/ruleset.xml | 230 +++++++++--------- 7 files changed, 129 insertions(+), 130 deletions(-) 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 f49cd0e81..0cab33eab 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 eff10ff59..074bf7eae 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 22aced3f9..fee1706fa 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 6489c544f..c37a88e1b 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 dd2add1d7..b0d122fe9 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 76fcf67a1..9a2ecd18e 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/ddk-configuration/pmd/ruleset.xml b/ddk-configuration/pmd/ruleset.xml index cca425c72..64bc55050 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 From fac83d7a5b6041d88d8c22b87303f57b361378b6 Mon Sep 17 00:00:00 2001 From: Joao Ferreira Date: Tue, 27 Jan 2026 08:46:46 +0100 Subject: [PATCH 04/15] chore: add JUnit 5 migration script and update test suites to use @SelectPackages --- .../com/avaloq/tools/ddk/xtext/AllTests.java | 41 +- .../tools/ddk/xtext/XtextTestSuite.java | 36 +- scripts/fix_junit5_visibility.py | 354 ++++++++++++++++++ 3 files changed, 374 insertions(+), 57 deletions(-) create mode 100644 scripts/fix_junit5_visibility.py 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 index 491538291..34c3fe7d0 100644 --- 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 @@ -10,47 +10,24 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext; -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.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. + * Main test suite for all DDK tests. Uses package scanning to discover tests. */ // 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 +@SelectPackages({ + "com.avaloq.tools.ddk.xtext", + "com.avaloq.tools.ddk.check", + "com.avaloq.tools.ddk.checkcfg", + "com.avaloq.tools.ddk.typesystem", + "com.avaloq.tools.ddk.sample.helloworld" }) // @Format-On -public class AllTests { +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 index 4bc9db01c..a4d301988 100644 --- 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 @@ -10,37 +10,23 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext; -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.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. + * Test suite for core Xtext tests. */ // @Format-Off @Suite -@SelectClasses({ - AbstractFragmentProviderTest.class, - ShortFragmentProviderTest.class, - AbstractSelectorFragmentProviderTest.class, - ResourceDescriptionDeltaTest.class, - XtextBuildTriggerTest.class, - FormatterTest.class, - QualifiedNamePatternTest.class, - BugAig1084.class, - RuntimeProjectUtilTest.class, - QualifiedNameSegmentTreeLookupTest.class}) +@SelectPackages({ + "com.avaloq.tools.ddk.xtext.builder", + "com.avaloq.tools.ddk.xtext.jupiter.formatter", + "com.avaloq.tools.ddk.xtext.linking", + "com.avaloq.tools.ddk.xtext.naming", + "com.avaloq.tools.ddk.xtext.resource", + "com.avaloq.tools.ddk.xtext.util" +}) // @Format-On -public class XtextTestSuite { +class XtextTestSuite { } diff --git a/scripts/fix_junit5_visibility.py b/scripts/fix_junit5_visibility.py new file mode 100644 index 000000000..4c92d5013 --- /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() From 8d9d8e66f6f089ca38d4ab86e0d0216cd3129a12 Mon Sep 17 00:00:00 2001 From: Joao Ferreira Date: Tue, 27 Jan 2026 08:51:08 +0100 Subject: [PATCH 05/15] refactor: convert test classes to JUnit 5 package-private visibility --- .../core/test/AbstractCheckTestCase.java | 2 +- .../tools/ddk/check/core/test/BugAig1314.java | 2 +- .../tools/ddk/check/core/test/BugDsl27.java | 2 +- .../check/test/core/CheckCoreTestSuite.java | 27 ++------ .../resource/CheckBatchLinkableResource.java | 1 - .../runtime/context/CheckContextTest.java | 2 +- .../registry/CheckExtensionPointTests.java | 2 +- .../core/validation/CheckValidatorTest.java | 2 +- .../label/CheckRuleLabelProviderTest.java | 2 +- .../test/core/CheckRuntimeTestSuite.java | 23 +++---- .../CheckExecutionEnvironmentTestSuite.java | 13 ++-- .../tests/CheckLibraryChecksTestSuite.java | 11 ++-- .../check/ui/test/CheckCatalogWizardTest.java | 22 +++---- .../check/ui/test/CheckProjectWizardTest.java | 14 ++--- .../ddk/check/ui/test/CheckUiTestSuite.java | 21 ++----- .../builder/CheckContextsExtensionTest.java | 10 +-- .../builder/CheckMarkerHelpExtensionTest.java | 12 ++-- .../test/builder/CheckTocExtensionTest.java | 12 ++-- .../ui/test/contentassist/BugAig931Test.java | 5 +- .../ui/builder/CheckContextsGenerator.java | 1 - .../ddk/checkcfg/test/CheckCfgTestSuite.java | 28 +++------ .../validation/CheckCfgValidationTest.java | 4 +- .../checkcfg/ui/test/CheckCfgUiTestSuite.java | 2 +- .../test/HelloWorldSampleTestSuite.java | 20 +++--- .../test/core/junit/runners/ClassRunner.java | 1 - .../tools/ddk/test/ui/test/AllTests.java | 13 ++-- .../ui/test/logging/ErrorLogListenerTest.java | 8 +-- .../test/swtbot/DeChKeyboardLayoutTest.java | 4 +- .../test/ui/test/swtbot/SwtBotRadioTest.java | 6 +- .../typesystem/AbstractTypeProviderTest.java | 2 +- .../BuiltInTypeModelAccessTest.java | 2 +- .../typesystem/ParameterListMatcherTest.java | 2 +- .../typesystem/test/TypeSystemTestSuite.java | 18 ++---- .../builder/layered/XtextBuildTrigger.java | 2 +- .../export/exporting/ExportExportingTest.java | 2 +- .../formatting/ExportFormattingTest.java | 2 +- .../export/scoping/ExportScopingTest.java | 12 ++-- .../validation/ExportValidationOkTest.java | 2 +- .../validation/ExportValidationTest.java | 2 +- .../xtext/test/export/ExportTestSuite.java | 20 +++--- .../builder/FormatBuilderParticipantTest.java | 6 +- .../formatting/FormatFormattingTest.java | 2 +- .../format/scoping/FormatScopingTest.java | 14 ++--- .../validation/FormatValidationTest.java | 24 +++---- .../xtext/test/format/FormatTestSuite.java | 18 +++--- .../expression/CodeGenerationXTest.java | 2 +- .../expression/CompilationContextTest.java | 2 +- .../expression/ExpressionsExtentionsTest.java | 2 +- .../test/generator/GeneratorTestSuite.java | 19 ++---- .../test/util/EClassComparatorTest.java | 2 +- .../xtext/generator/test/util/GraphTest.java | 2 +- .../AbstractAcfContentAssistTest.java | 1 - .../formatting/AbstractFormattingTest.java | 4 +- .../test/generator/AbstractGeneratorTest.java | 2 +- .../test/junit/runners/XtextClassRunner.java | 1 - .../jupiter/AbstractAcfContentAssistTest.java | 1 - .../test/jupiter/AbstractFormattingTest.java | 4 +- .../ui/labeling/AbstractLabelingTest.java | 2 +- .../test/ui/outline/AbstractOutlineTest.java | 2 +- .../xtext/builder/XtextBuildTriggerTest.java | 6 +- .../ddk/xtext/formatter/FormatterTest.java | 62 +++++++++---------- .../jupiter/formatter/FormatterTest.java | 62 +++++++++---------- .../linking/AbstractFragmentProviderTest.java | 8 +-- .../linking/ShortFragmentProviderTest.java | 8 +-- .../naming/QualifiedNamePatternTest.java | 22 +++---- .../QualifiedNameSegmentTreeLookupTest.java | 24 +++---- .../AbstractSelectorFragmentProviderTest.java | 12 ++-- .../tools/ddk/xtext/resource/BugAig1084.java | 4 +- .../ResourceDescriptionDeltaTest.java | 12 ++-- .../xtext/util/RuntimeProjectUtilTest.java | 12 ++-- .../resource/AbstractFingerprintComputer.java | 1 - .../AbstractStreamingFingerprintComputer.java | 1 - 72 files changed, 299 insertions(+), 383 deletions(-) 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 21ac794f3..7ed4780ee 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 be1c683a8..31394387e 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 dd1ea2081..3d5e7973c 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 91ee1b81e..97b4a29eb 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 7e44dad8b..269342534 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 6fe8e0877..5a427fc88 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 be407539b..109474d0a 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 bb60b5682..a8e64e841 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 35c30852b..9247eea27 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 610aadb75..62c204fda 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 a218c4de5..f2c7134be 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 abedf3c56..312daec5b 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 7ddf752f3..7046123d1 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 71323ec6d..a00c60f49 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 de6a8964e..f66f5908b 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 7320a1238..35322cb48 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 7ca8b94d4..69bf57514 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 8a865abb1..259b62a70 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 459c7a8e9..82cc18765 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 e68a2ed1f..ff23bcfca 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 17b83cf1f..5a07a895f 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 e78117de6..f0e109700 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 60866c7ab..afc0009f1 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 45a1fa607..d97a8ba68 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 60074e5ac..fabcf58c8 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 2491d2893..61de9c14c 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 a5cb3d3b2..488238139 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 e65274a10..f97611701 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 6f4846e60..e99d7eb92 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 @@ 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 cf54677ec..02a2dc82c 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 4653a8775..d694f46be 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 f22eb2259..9451cc413 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 82b3a5f26..6fb5169cf 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 27c181fe2..07e34ad48 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 a128765d2..4fa203e17 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() { 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 431855c9c..96e063653 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 67f16199e..3c97dd4c3 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 ca1b97faa..0eb726709 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() { 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 3eaa8fac2..16ea11c30 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() { 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 1eee32680..52f1d8259 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 a6bfd8bc3..a62890087 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 0da7073bd..bcd5d97f9 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 d088a6a14..791bff5d3 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 62a80a86b..76384bba4 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 4baf7095f..3ae064a79 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 772a8220f..02f4404b3 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 b0ada1b62..e50f0dad5 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 541d9f785..2747b04f0 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 d4c3f4ed0..c798d052e 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 acd767479..a2273e0be 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 d8a7a3316..e1fd0b23b 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 569fc457e..33bb772e9 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 7fa54de3e..51654a5bc 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 1877aebb2..01165a2a3 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 b616167c5..7124d8f2e 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 aa945db99..e0f0f9794 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 b2d495908..51ecf4eec 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 e5b728d92..5503e9ef5 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 4aed59246..fcaacb681 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/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 47642e3ec..896638795 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 3a2013c06..f4c8e4a40 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 63fb4f7a4..82a8c3ab7 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 58f1f104d..2a2ac3c3b 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 b173de48d..98bf730ae 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 8b8993543..ac11917da 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 5490343e0..872cbd655 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 625c3eb82..1e85eaaf7 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 a2d550034..794527974 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 e60dca786..5c9cf5e48 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 58d137463..5331e1c13 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/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 8abc20beb..3c49e9c1d 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 @@ -517,7 +517,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 fa6952942..bf9223d12 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) { From b1724c659539ef3ee0f3753c4d84a0b876500671 Mon Sep 17 00:00:00 2001 From: Joao Ferreira Date: Tue, 27 Jan 2026 08:58:04 +0100 Subject: [PATCH 06/15] fix: make export test methods package-private for PMD compliance --- .../ddk/xtext/export/scoping/ExportScopingTest.xtext | 8 ++++++++ .../xtext/export/exporting/ExportExportingTest.java | 2 +- .../export/validation/ExportValidationOkTest.java | 2 +- .../xtext/export/validation/ExportValidationTest.java | 10 +++++----- 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext diff --git a/com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext b/com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext new file mode 100644 index 000000000..6e5673740 --- /dev/null +++ b/com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext @@ -0,0 +1,8 @@ +grammar com.avaloq.tools.ddk.xtext.export.scoping.ExportScopingTest with org.eclipse.xtext.common.Terminals + +import "http://www.avaloq.com/tools/ddk/xtext/export/Export" + +Model: + expressions+=InterfaceExpression* + userData+=UserData* +; 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 4fa203e17..6ff4f01d8 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 @@ -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/validation/ExportValidationOkTest.java b/com.avaloq.tools.ddk.xtext.export.test/src/com/avaloq/tools/ddk/xtext/export/validation/ExportValidationOkTest.java index 0eb726709..b1f61fee0 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 @@ -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 16ea11c30..87f1c7247 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 @@ -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(""); } From 6bb2f8218800c17c41a1893fbd3627887c2cea81 Mon Sep 17 00:00:00 2001 From: Joao Ferreira Date: Tue, 27 Jan 2026 09:43:49 +0100 Subject: [PATCH 07/15] fix: remove JUnit 5 suite classes, use Tycho test discovery - Remove AllTests.java and XtextTestSuite.java - JUnit 5 @SelectPackages doesn't work with OSGi bundleresource:// URIs - Add pattern for *Test.java in tycho-surefire-plugin - Let Tycho discover tests by naming convention instead - Remove ExportScopingTest.xtext (was added for testing, not in master) --- .../export/scoping/ExportScopingTest.xtext | 8 ----- com.avaloq.tools.ddk.xtext.test/pom.xml | 9 +++-- .../com/avaloq/tools/ddk/xtext/AllTests.java | 33 ------------------- .../tools/ddk/xtext/XtextTestSuite.java | 32 ------------------ 4 files changed, 7 insertions(+), 75 deletions(-) delete mode 100644 com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext delete mode 100644 com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/AllTests.java delete mode 100644 com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/XtextTestSuite.java diff --git a/com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext b/com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext deleted file mode 100644 index 6e5673740..000000000 --- a/com.avaloq.tools.ddk.xtext.export.test/resource/com/avaloq/tools/ddk/xtext/export/scoping/ExportScopingTest.xtext +++ /dev/null @@ -1,8 +0,0 @@ -grammar com.avaloq.tools.ddk.xtext.export.scoping.ExportScopingTest with org.eclipse.xtext.common.Terminals - -import "http://www.avaloq.com/tools/ddk/xtext/export/Export" - -Model: - expressions+=InterfaceExpression* - userData+=UserData* -; diff --git a/com.avaloq.tools.ddk.xtext.test/pom.xml b/com.avaloq.tools.ddk.xtext.test/pom.xml index 663983c34..5e47532af 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 34c3fe7d0..000000000 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/AllTests.java +++ /dev/null @@ -1,33 +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.SelectPackages; -import org.junit.platform.suite.api.Suite; - - -/** - * Main test suite for all DDK tests. Uses package scanning to discover tests. - */ -// CHECKSTYLE:OFF HideUtilityClassConstructor - -// @Format-Off -@Suite -@SelectPackages({ - "com.avaloq.tools.ddk.xtext", - "com.avaloq.tools.ddk.check", - "com.avaloq.tools.ddk.checkcfg", - "com.avaloq.tools.ddk.typesystem", - "com.avaloq.tools.ddk.sample.helloworld" -}) -// @Format-On -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 a4d301988..000000000 --- a/com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/XtextTestSuite.java +++ /dev/null @@ -1,32 +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.SelectPackages; -import org.junit.platform.suite.api.Suite; - - -/** - * Test suite for core Xtext tests. - */ -// @Format-Off -@Suite -@SelectPackages({ - "com.avaloq.tools.ddk.xtext.builder", - "com.avaloq.tools.ddk.xtext.jupiter.formatter", - "com.avaloq.tools.ddk.xtext.linking", - "com.avaloq.tools.ddk.xtext.naming", - "com.avaloq.tools.ddk.xtext.resource", - "com.avaloq.tools.ddk.xtext.util" -}) -// @Format-On -class XtextTestSuite { -} From 29805e2c4daeb0d0161be9b7ceb37bb64529774f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Fri, 6 Feb 2026 23:56:37 +0100 Subject: [PATCH 08/15] fix: ensure all Bug* tests are discoverable and standardize test suites - Rename BugAig1314, BugDsl27, BugAig1084 to *Test suffix so they match JUnit 5 default class name pattern and Tycho's **/*Test.java convention - Add missing expression package to GeneratorTestSuite @SelectPackages - Add @IncludeClassNamePatterns(".*Test.*") to all suites for consistency Co-Authored-By: Claude Opus 4.6 --- .../check/core/test/{BugAig1314.java => BugAig1314Test.java} | 4 ++-- .../ddk/check/core/test/{BugDsl27.java => BugDsl27Test.java} | 4 ++-- .../avaloq/tools/ddk/check/test/core/CheckCoreTestSuite.java | 2 ++ .../runtime/tests/CheckExecutionEnvironmentTestSuite.java | 2 ++ .../check/test/runtime/tests/CheckLibraryChecksTestSuite.java | 2 ++ .../com/avaloq/tools/ddk/check/ui/test/CheckUiTestSuite.java | 2 ++ .../src/com/avaloq/tools/ddk/test/ui/test/AllTests.java | 2 ++ .../xtext/generator/test/generator/GeneratorTestSuite.java | 4 +++- .../xtext/resource/{BugAig1084.java => BugAig1084Test.java} | 2 +- .../com/avaloq/tools/ddk/xtext/ui/test/XtextUiTestSuite.java | 2 ++ 10 files changed, 20 insertions(+), 6 deletions(-) rename com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/{BugAig1314.java => BugAig1314Test.java} (96%) rename com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/{BugDsl27.java => BugDsl27Test.java} (86%) rename com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/{BugAig1084.java => BugAig1084Test.java} (96%) 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/BugAig1314Test.java similarity index 96% rename from com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugAig1314.java rename to com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugAig1314Test.java index 31394387e..aaae4b455 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/BugAig1314Test.java @@ -42,7 +42,7 @@ @ExtendWith(InjectionExtension.class) @InjectWith(CheckInjectorProvider.class) @SuppressWarnings("nls") -class BugAig1314 { +class BugAig1314Test { /** Constructor of super class is protected... */ private static class TestScope extends CatalogFromExtensionPointScope { @@ -74,7 +74,7 @@ private ModelLocation createModelLocation(final URL url) { return new ModelLocation(url, TEST_CATALOG_FILE + TEST_CATALOG_EXTENSION) { @Override public InputStream getCatalogStream() { - return BugAig1314.class.getResourceAsStream(TEST_CATALOG_FILE); + return BugAig1314Test.class.getResourceAsStream(TEST_CATALOG_FILE); } }; } 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/BugDsl27Test.java similarity index 86% rename from com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugDsl27.java rename to com.avaloq.tools.ddk.check.core.test/src/com/avaloq/tools/ddk/check/core/test/BugDsl27Test.java index 3d5e7973c..220f7f842 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/BugDsl27Test.java @@ -27,14 +27,14 @@ @InjectWith(CheckInjectorProvider.class) @ExtendWith(InjectionExtension.class) @SuppressWarnings("nls") -class BugDsl27 extends AbstractCheckGenerationTestCase { +class BugDsl27Test extends AbstractCheckGenerationTestCase { /** * Tests that our test source compiles fine. */ @Test void testGeneratedCodeHasNoErrors() { - try (InputStream sourceStream = BugDsl27.class.getResourceAsStream("bugdsl27/BugDsl27")) { + try (InputStream sourceStream = BugDsl27Test.class.getResourceAsStream("bugdsl27/BugDsl27")) { generateAndCompile(sourceStream); } catch (IOException exception) { LOGGER.info("Failed to close the test file"); 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 97b4a29eb..b8b0c3741 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,6 +10,7 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.test.core; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -22,6 +23,7 @@ @SelectPackages({ "com.avaloq.tools.ddk.check.core.test" }) +@IncludeClassNamePatterns(".*Test.*") class CheckCoreTestSuite { } 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 f2c7134be..971fc2a29 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,6 +10,7 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.test.runtime.tests; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -22,6 +23,7 @@ @SelectPackages({ "com.avaloq.tools.ddk.check.test.runtime" }) +@IncludeClassNamePatterns(".*Test.*") 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 312daec5b..4e038ac86 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,6 +11,7 @@ package com.avaloq.tools.ddk.check.test.runtime.tests; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -23,6 +24,7 @@ @SelectPackages({ "com.avaloq.tools.ddk.check.test.runtime.label" }) +@IncludeClassNamePatterns(".*Test.*") class CheckLibraryChecksTestSuite { } 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 f66f5908b..a3e30da64 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,6 +10,7 @@ *******************************************************************************/ package com.avaloq.tools.ddk.check.ui.test; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -26,5 +27,6 @@ "com.avaloq.tools.ddk.check.ui.test.quickfix" }) // @Format-On +@IncludeClassNamePatterns(".*Test.*") class CheckUiTestSuite { } 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 61de9c14c..ed9c1ce3e 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,6 +10,7 @@ *******************************************************************************/ package com.avaloq.tools.ddk.test.ui.test; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -22,5 +23,6 @@ @SelectPackages({ "com.avaloq.tools.ddk.test.ui.test.swtbot" }) +@IncludeClassNamePatterns(".*Test.*") class AllTests { } 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 c798d052e..d20523423 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,6 +10,7 @@ *******************************************************************************/ package com.avaloq.tools.ddk.xtext.generator.test.generator; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -20,8 +21,9 @@ */ @Suite @SelectPackages({ + "com.avaloq.tools.ddk.xtext.generator.expression", "com.avaloq.tools.ddk.xtext.generator.test.util" }) - +@IncludeClassNamePatterns(".*Test.*") class GeneratorTestSuite { } 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/BugAig1084Test.java similarity index 96% rename from com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/BugAig1084.java rename to com.avaloq.tools.ddk.xtext.test/src/com/avaloq/tools/ddk/xtext/resource/BugAig1084Test.java index 794527974..0a8e2b96e 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/BugAig1084Test.java @@ -24,7 +24,7 @@ import com.google.common.collect.Lists; -class BugAig1084 { +class BugAig1084Test { /** * Test that recursive calls to {@link ResourceDescription2#getLookUp()} by {@link ResourceDescription2#computeExportedObjects()} do not cause 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 9a2ecd18e..c6676ce6a 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,6 +11,7 @@ package com.avaloq.tools.ddk.xtext.ui.test; +import org.junit.platform.suite.api.IncludeClassNamePatterns; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; @@ -25,5 +26,6 @@ "com.avaloq.tools.ddk.xtext.ui.templates" // @Format-On }) +@IncludeClassNamePatterns(".*Test.*") class XtextUiTestSuite { } From 5981ad03b836dbfea9d5d330785776ad4a43083d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 00:30:46 +0100 Subject: [PATCH 09/15] fix: remove public modifiers from members in package-private test classes Fix PMD PublicMemberInNonPublicType violations: constructors, methods, fields, and inner classes that were still public in package-private test classes are now package-private. Co-Authored-By: Claude Opus 4.6 --- .../ddk/check/runtime/context/CheckContextTest.java | 10 +++++----- .../ddk/check/ui/test/CheckCatalogWizardTest.java | 2 +- .../ddk/check/ui/test/CheckProjectWizardTest.java | 4 ++-- .../tools/ddk/test/ui/test/swtbot/SwtBotRadioTest.java | 4 ++-- .../ddk/xtext/export/scoping/ExportScopingTest.java | 2 +- .../format/builder/FormatBuilderParticipantTest.java | 2 +- .../tools/ddk/xtext/formatter/FormatterTest.java | 2 +- .../ddk/xtext/jupiter/formatter/FormatterTest.java | 2 +- .../ddk/xtext/linking/ShortFragmentProviderTest.java | 2 +- .../ddk/xtext/naming/QualifiedNamePatternTest.java | 2 +- .../naming/QualifiedNameSegmentTreeLookupTest.java | 4 ++-- .../resource/AbstractSelectorFragmentProviderTest.java | 2 +- .../tools/ddk/xtext/util/RuntimeProjectUtilTest.java | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) 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 5a427fc88..86d18d3fd 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 @@ -23,11 +23,11 @@ @SuppressWarnings("nls") class CheckContextTest { - public static final String ENABLED_ISSUE_CODE = "Enabled.Issue.Code"; - public static final String DISABLED_ISSUE_CODE = "Disabled.Issue.Code"; - public static final String DISABLED_AND_ENABLED_ISSUE_CODE = "Disabled.Enabled.Issue.Code"; - public static final String ENABLED_AND_DISABLED_ISSUE_CODE = "Enaabled.Disabled.Issue.Code"; - public static final String NOT_MENTIONED_ISSUE_CODE = "Not.Mentioned.Issue.Code"; + static final String ENABLED_ISSUE_CODE = "Enabled.Issue.Code"; + static final String DISABLED_ISSUE_CODE = "Disabled.Issue.Code"; + static final String DISABLED_AND_ENABLED_ISSUE_CODE = "Disabled.Enabled.Issue.Code"; + static final String ENABLED_AND_DISABLED_ISSUE_CODE = "Enaabled.Disabled.Issue.Code"; + static final String NOT_MENTIONED_ISSUE_CODE = "Not.Mentioned.Issue.Code"; private static final EObject DUMMY_CONTEXT = null; // Wrap up null nicely /** 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 7046123d1..e00e42f48 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 @@ -249,7 +249,7 @@ void testCatalogName() { * Tests that initially no grammar is selected, so pressing finish is disabled if no grammar is chosen. */ @BugTest("AIG-708") - public void testInitiallyNoGrammarSelected() { + void testInitiallyNoGrammarSelected() { selectProjectFolder(wizard, VALID_PACKAGE_NAME); initializeWizardBot(); 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 a00c60f49..9757e90d2 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 @@ -80,7 +80,7 @@ void testProjectNameInvalid() { * Tests that the 'finish' button is not enabled in the project page. */ @BugTest("AIG-490") - public void testFinishButtonDisabledInProjectPage() { + void testFinishButtonDisabledInProjectPage() { CheckWizardTestUtil.projectName(wizard, "valid.project.name", CheckWizardTestUtil.NEXT_ENABLED, CheckWizardTestUtil.FINISH_DISABLED); } @@ -110,7 +110,7 @@ void fieldValuesAfterPageChange() { * Tests that applying the next button changes the wizard page. */ @BugTest("AIG-479") - public void testNextButtonChangesPage() { + void testNextButtonChangesPage() { wizard.writeToTextField(Messages.PROJECT_NAME_LABEL, "a.b"); SWTBotShell projectPage = wizard.shell(Messages.PROJECT_WIZARD_WINDOW_TITLE); wizard.changeToNextPage(); 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 e99d7eb92..87d0b0fa2 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 @@ -30,8 +30,8 @@ class SwtBotRadioTest { @RegisterExtension - // CHECKSTYLE:CHECK-OFF VisibilityModifier - public final IssueAwareRule rule = IssueAwareRule.getInstance(); + // CHECKSTYLE:CHECK-OFF VisibilityModifier - JUnit 5 @RegisterExtension requires non-private + final IssueAwareRule rule = IssueAwareRule.getInstance(); // CHECKSTYLE:CHECK-ON VisibilityModifier private static final String[] PREFERENCES_PATH = new String[] {"General", "Perspectives"}; 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 3c97dd4c3..6683d61c9 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 @@ -31,7 +31,7 @@ */ @SuppressWarnings("nls") class ExportScopingTest extends AbstractScopingTest { - public ExportScopingTest() { + ExportScopingTest() { super(new NullMapper()); } 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 a62890087..70ef258f9 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 @@ -109,7 +109,7 @@ protected Injector getInjector() { /** * A Matcher for {@link URI}. */ - public static class IsUri implements ArgumentMatcher { + static class IsUri implements ArgumentMatcher { @Override public boolean matches(final URI argument) { 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 f4c8e4a40..358b41766 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 @@ -404,7 +404,7 @@ void suppressedWhitespace() throws IOException { // TODO: investigate whether to include test or not - currently this test // would fail @Ignore - public void suppressedLinewrap() throws IOException { + void suppressedLinewrap() throws IOException { String model = "test linewrap\n`foo%abcd%foo%< b\n>%abcd%foo%abcd%foo%abcd%" + "foo%abcd%foo%abcd%foo%abcd%foo%abcd%foo%abcd%foo%xx%foo%abcd%foo%abcd%" + "foo%abcd%foo%<\nb >%foo%abcd` post;"; assertFormattedPTC(model, 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 82a8c3ab7..7d5d4e1c5 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 @@ -404,7 +404,7 @@ void suppressedWhitespace() throws IOException { // TODO: investigate whether to include test or not - currently this test // would fail @Disabled - public void suppressedLinewrap() throws IOException { + void suppressedLinewrap() throws IOException { String model = "test linewrap\n`foo%abcd%foo%< b\n>%abcd%foo%abcd%foo%abcd%" + "foo%abcd%foo%abcd%foo%abcd%foo%abcd%foo%abcd%foo%xx%foo%abcd%foo%abcd%" + "foo%abcd%foo%<\nb >%foo%abcd` post;"; assertFormattedPTC(model, model); 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 98bf730ae..755dc2777 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 @@ -90,7 +90,7 @@ void cleanup() { } @BugTest(value = "DSL-601") - public void testLongFragment() { + void testLongFragment() { int reps = 100; 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 ac11917da..72409a7e8 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 @@ -172,7 +172,7 @@ private void assertNoMatch(final QualifiedNamePattern pattern, final String... s @BugTest("DSL-209") @SuppressWarnings("PMD.UseAssertSameInsteadOfAssertTrue") // The comparator structure of ==, > and < should be clear in the tests. - public void testComparison() { + void testComparison() { // basic wild cards assertTrue(0 > comparePattern(createPattern("foo", "abc*"), createName("foo", "abcd"))); assertTrue(0 > comparePattern(createPattern("foo*"), createName("foo", "abcd"))); 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 872cbd655..09a441bfd 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 @@ -225,7 +225,7 @@ private QualifiedNamePattern pattern(final QualifiedName name) { return QualifiedNamePattern.create(name); } - public URI uri(final QualifiedName name) { + URI uri(final QualifiedName name) { return URI.createURI("scheme:/" + name); } @@ -236,7 +236,7 @@ private URI put(final String name) { return value; } - public void assertContentEquals(final Collection expected, final Collection actual) { + void assertContentEquals(final Collection expected, final Collection actual) { assertEquals(ImmutableSet.copyOf(expected), ImmutableSet.copyOf(actual)); } } 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 1e85eaaf7..d874dc108 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 @@ -84,7 +84,7 @@ private void assertFragmentMatchesAndResolves(final Resource res, final String e assertSame(obj, res.getEObject(fragment)); } - public EObject getModel(final String model) { + EObject getModel(final String model) { try { return parseHelper.parse(model); } catch (Exception e) { 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 5331e1c13..dee630bc6 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 @@ -44,7 +44,7 @@ class RuntimeProjectUtilTest extends AbstractUtilTest { private static final String WORKSPACE_PATH = ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath(); - public static final List SOURCE_NAMES = ImmutableList.of("FormatBuilderParticipantInput.format", "FormatBuilderParticipantOutput.format"); + static final List SOURCE_NAMES = ImmutableList.of("FormatBuilderParticipantInput.format", "FormatBuilderParticipantOutput.format"); private static URI uriInCorrect; private static IStorage2UriMapper mapperInCorrect; From 67f9d2b8acfc3377f566c2b0ab9b9c62cdcfd419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 01:05:42 +0100 Subject: [PATCH 10/15] ci: enable tycho-surefire for non-UI test modules Enable test execution for 7 non-UI test modules that have been skipped since the initial open-source contribution (2016). The parent POM has true for tycho-surefire-plugin, and only xtext.test overrode it. Modules enabled: - com.avaloq.tools.ddk.typesystem.test - com.avaloq.tools.ddk.check.core.test - com.avaloq.tools.ddk.check.runtime.core.test - com.avaloq.tools.ddk.checkcfg.core.test - com.avaloq.tools.ddk.xtext.export.test - com.avaloq.tools.ddk.xtext.format.test - com.avaloq.tools.ddk.xtext.generator.test Co-Authored-By: Claude Opus 4.6 --- com.avaloq.tools.ddk.check.core.test/pom.xml | 21 ++++++++++++++++++- .../pom.xml | 21 ++++++++++++++++++- .../pom.xml | 21 ++++++++++++++++++- com.avaloq.tools.ddk.typesystem.test/pom.xml | 19 ++++++++++++++++- .../pom.xml | 19 ++++++++++++++++- .../pom.xml | 19 ++++++++++++++++- .../pom.xml | 19 ++++++++++++++++- 7 files changed, 132 insertions(+), 7 deletions(-) diff --git a/com.avaloq.tools.ddk.check.core.test/pom.xml b/com.avaloq.tools.ddk.check.core.test/pom.xml index a98f840c9..2acc43146 100644 --- a/com.avaloq.tools.ddk.check.core.test/pom.xml +++ b/com.avaloq.tools.ddk.check.core.test/pom.xml @@ -9,4 +9,23 @@ com.avaloq.tools.ddk.check.core.test eclipse-test-plugin - \ No newline at end of file + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + **/*Tests.java + + false + false + + + + + diff --git a/com.avaloq.tools.ddk.check.runtime.core.test/pom.xml b/com.avaloq.tools.ddk.check.runtime.core.test/pom.xml index 36e1cf81d..f338eefb6 100644 --- a/com.avaloq.tools.ddk.check.runtime.core.test/pom.xml +++ b/com.avaloq.tools.ddk.check.runtime.core.test/pom.xml @@ -9,4 +9,23 @@ com.avaloq.tools.ddk.check.runtime.core.test eclipse-test-plugin - \ No newline at end of file + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + **/*Tests.java + + false + false + + + + + diff --git a/com.avaloq.tools.ddk.checkcfg.core.test/pom.xml b/com.avaloq.tools.ddk.checkcfg.core.test/pom.xml index 67373853b..75f67d507 100644 --- a/com.avaloq.tools.ddk.checkcfg.core.test/pom.xml +++ b/com.avaloq.tools.ddk.checkcfg.core.test/pom.xml @@ -9,4 +9,23 @@ com.avaloq.tools.ddk.checkcfg.core.test eclipse-test-plugin - \ No newline at end of file + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + **/*Tests.java + + false + false + + + + + diff --git a/com.avaloq.tools.ddk.typesystem.test/pom.xml b/com.avaloq.tools.ddk.typesystem.test/pom.xml index 38e5dddf1..2b1479e34 100644 --- a/com.avaloq.tools.ddk.typesystem.test/pom.xml +++ b/com.avaloq.tools.ddk.typesystem.test/pom.xml @@ -10,4 +10,21 @@ com.avaloq.tools.ddk.typesystem.test eclipse-test-plugin - \ No newline at end of file + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + + + + + diff --git a/com.avaloq.tools.ddk.xtext.export.test/pom.xml b/com.avaloq.tools.ddk.xtext.export.test/pom.xml index ebf861e38..c5803e5dc 100644 --- a/com.avaloq.tools.ddk.xtext.export.test/pom.xml +++ b/com.avaloq.tools.ddk.xtext.export.test/pom.xml @@ -10,4 +10,21 @@ com.avaloq.tools.ddk.xtext.export.test eclipse-test-plugin - \ No newline at end of file + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + + + + + diff --git a/com.avaloq.tools.ddk.xtext.format.test/pom.xml b/com.avaloq.tools.ddk.xtext.format.test/pom.xml index f1c6ae16f..4ee834df6 100644 --- a/com.avaloq.tools.ddk.xtext.format.test/pom.xml +++ b/com.avaloq.tools.ddk.xtext.format.test/pom.xml @@ -10,4 +10,21 @@ com.avaloq.tools.ddk.xtext.format.test eclipse-test-plugin - \ No newline at end of file + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + + + + + diff --git a/com.avaloq.tools.ddk.xtext.generator.test/pom.xml b/com.avaloq.tools.ddk.xtext.generator.test/pom.xml index 63665a4ab..b59f2f9f3 100644 --- a/com.avaloq.tools.ddk.xtext.generator.test/pom.xml +++ b/com.avaloq.tools.ddk.xtext.generator.test/pom.xml @@ -10,4 +10,21 @@ com.avaloq.tools.ddk.xtext.generator.test eclipse-test-plugin - \ No newline at end of file + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + + + + + From 813fd34ea62c9bac49f701bafee0f27dadc4a179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 01:07:43 +0100 Subject: [PATCH 11/15] ci: enable tycho-surefire for UI test modules Enable test execution for 4 UI test modules with full Eclipse workbench harness configuration (useUIHarness, product, application) modeled after the working xtext.test configuration. Modules enabled: - com.avaloq.tools.ddk.check.ui.test (SWTBot tests) - com.avaloq.tools.ddk.test.ui.test (SWTBot tests) - com.avaloq.tools.ddk.xtext.ui.test - com.avaloq.tools.ddk.sample.helloworld.ui.test Note: checkcfg.ui.test is eclipse-plugin (not eclipse-test-plugin), so tycho-surefire does not apply to it. Co-Authored-By: Claude Opus 4.6 --- com.avaloq.tools.ddk.check.ui.test/pom.xml | 32 ++++++++++++++++++- .../pom.xml | 30 +++++++++++++++++ com.avaloq.tools.ddk.test.ui.test/pom.xml | 30 +++++++++++++++++ com.avaloq.tools.ddk.xtext.ui.test/pom.xml | 32 ++++++++++++++++++- 4 files changed, 122 insertions(+), 2 deletions(-) diff --git a/com.avaloq.tools.ddk.check.ui.test/pom.xml b/com.avaloq.tools.ddk.check.ui.test/pom.xml index b6979a569..8366c7b68 100644 --- a/com.avaloq.tools.ddk.check.ui.test/pom.xml +++ b/com.avaloq.tools.ddk.check.ui.test/pom.xml @@ -9,4 +9,34 @@ com.avaloq.tools.ddk.check.ui.test eclipse-test-plugin - \ No newline at end of file + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + true + ${test.timeout} + -Dlogback.configurationFile="${runtime.logbackConfig}" ${test.javaOptions} + -pluginCustomization ${runtime.pluginCustomization} + ${runtime.product} + org.eclipse.ui.ide.workbench + + + p2-installable-unit + org.eclipse.platform.feature.group + + + + + + + diff --git a/com.avaloq.tools.ddk.sample.helloworld.ui.test/pom.xml b/com.avaloq.tools.ddk.sample.helloworld.ui.test/pom.xml index f5d1c062e..072db5df2 100644 --- a/com.avaloq.tools.ddk.sample.helloworld.ui.test/pom.xml +++ b/com.avaloq.tools.ddk.sample.helloworld.ui.test/pom.xml @@ -9,4 +9,34 @@ com.avaloq.tools.ddk com.avaloq.tools.ddk.sample.helloworld.ui.test eclipse-test-plugin + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + true + ${test.timeout} + -Dlogback.configurationFile="${runtime.logbackConfig}" ${test.javaOptions} + -pluginCustomization ${runtime.pluginCustomization} + ${runtime.product} + org.eclipse.ui.ide.workbench + + + p2-installable-unit + org.eclipse.platform.feature.group + + + + + + diff --git a/com.avaloq.tools.ddk.test.ui.test/pom.xml b/com.avaloq.tools.ddk.test.ui.test/pom.xml index ccf895819..702b4f874 100644 --- a/com.avaloq.tools.ddk.test.ui.test/pom.xml +++ b/com.avaloq.tools.ddk.test.ui.test/pom.xml @@ -9,4 +9,34 @@ com.avaloq.tools.ddk.test.ui.test eclipse-test-plugin + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + true + ${test.timeout} + -Dlogback.configurationFile="${runtime.logbackConfig}" ${test.javaOptions} + -pluginCustomization ${runtime.pluginCustomization} + ${runtime.product} + org.eclipse.ui.ide.workbench + + + p2-installable-unit + org.eclipse.platform.feature.group + + + + + + diff --git a/com.avaloq.tools.ddk.xtext.ui.test/pom.xml b/com.avaloq.tools.ddk.xtext.ui.test/pom.xml index ac68a07e3..bfb26d4c0 100644 --- a/com.avaloq.tools.ddk.xtext.ui.test/pom.xml +++ b/com.avaloq.tools.ddk.xtext.ui.test/pom.xml @@ -9,4 +9,34 @@ com.avaloq.tools.ddk.xtext.ui.test eclipse-test-plugin - \ No newline at end of file + + + + + org.eclipse.tycho + tycho-surefire-plugin + ${tycho.version} + + false + + **/*Test.java + + false + false + true + ${test.timeout} + -Dlogback.configurationFile="${runtime.logbackConfig}" ${test.javaOptions} + -pluginCustomization ${runtime.pluginCustomization} + ${runtime.product} + org.eclipse.ui.ide.workbench + + + p2-installable-unit + org.eclipse.platform.feature.group + + + + + + + From cfb3e35a669be0034f587b06ada8134ec5036527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 01:32:19 +0100 Subject: [PATCH 12/15] docs: add CI test report for all test modules (non-UI + UI) Summarizes test results from enabling tycho-surefire for all 11 test modules. 4 modules pass cleanly (+125 tests), 3 need UI harness, 1 has SWTBot issues, 1 has a test setup bug. Co-Authored-By: Claude Opus 4.6 --- TEST-REPORT.md | 179 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 TEST-REPORT.md diff --git a/TEST-REPORT.md b/TEST-REPORT.md new file mode 100644 index 000000000..dea19a336 --- /dev/null +++ b/TEST-REPORT.md @@ -0,0 +1,179 @@ +# CI Test Report — All Test Modules (Non-UI + UI) + +Results from enabling `tycho-surefire-plugin` for all 11 test modules (7 non-UI + 4 UI). + +CI Run: https://github.com/dsldevkit/dsl-devkit/actions/runs/21770332592 + +## Summary + +### UI Test Modules (new in this PR) + +| Module | Tests | Failures | Errors | Status | +|--------|------:|:--------:|:------:|:------:| +| `xtext.ui.test` | 40 | 0 | 0 | PASS | +| `check.ui.test` | 0 | 0 | 0 | PASS *(no tests found)* | +| `sample.helloworld.ui.test` | 0 | 0 | 0 | PASS *(no tests found)* | +| `test.ui.test` | 4 | 0 | 3 | FAIL | + +### Non-UI Test Modules (same as #1263) + +| Module | Tests | Failures | Errors | Status | +|--------|------:|:--------:|:------:|:------:| +| `xtext.export.test` | 14 | 0 | 0 | PASS | +| `typesystem.test` | 55 | 0 | 0 | PASS | +| `check.runtime.core.test` | 16 | 0 | 0 | PASS | +| `xtext.test` *(existing)* | 74 | 0 | 0 | PASS | +| `xtext.format.test` | 22 | 6 | 7 | FAIL | +| `xtext.generator.test` | 27 | 0 | 2 | FAIL | +| `checkcfg.core.test` | 10 | 5 | 1 | FAIL | +| `check.core.test` | 65 | 0 | 63 | FAIL | +| **Total** | **327** | **11** | **76** | | + +## Root Cause Analysis + +### `test.ui.test` — 3 errors (SWTBot widget not found) + +All 3 failures are `WidgetNotFoundException` — SWTBot cannot find expected widgets in the headless CI environment. + +**`SwtBotRadioTest.testSwtRadioButtonClick`:** +``` +org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: + Could not find widget matching: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH') + at SwtBotRadioTest.java:65 +``` + +**`SwtBotRadioTest.testSWTRadioButtonClick`:** +``` +org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: + Could not find widget matching: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH') + at SwtBotRadioTest.java:76 +``` + +**`DeChKeyboardLayoutTest.testDeChKeyboardLayout`:** +``` +org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: + Could not find menu bar for shell: Shell with text {Preferences} + at DeChKeyboardLayoutTest.java:39 +``` + +**Fix:** These tests rely on specific Eclipse dialogs being open. In the CI headless Xvfb environment, the dialogs may not render or the workbench may not fully initialize. Needs investigation of test setup (missing `@BeforeEach` to open the expected dialog/shell). + +### `xtext.ui.test` — 40 tests, all pass + +All 40 tests pass cleanly: +- `WorkbenchResolutionAdaptorRunTest` — 2 tests +- `WorkbenchResolutionAdaptorTest` — 4 tests +- `TemplateProposalProviderHelperTest` — 24 tests +- `SimpleEnumTemplateVariableResolverTest` — 3 tests +- `ResourceNameTemplateVariableResolverTest` — 7 tests + +### `check.core.test` — 63 errors (Guice injector needs UI) + +Nearly all tests fail with `com.google.inject.CreationException`. Tests use `CheckUiInjectorProvider`, which requires the Eclipse UI workbench. Despite being in a "core" test module, these tests depend on the UI injector. + +**Fix:** Run with `useUIHarness=true`, or move tests to `check.ui.test`. + +### `xtext.format.test` — 6 failures, 7 errors (injector + resource loading) + +Two distinct failure modes: + +1. **`FormatScopingTest` (6 errors):** `NullPointerException` — grammar fields are null because `FormatUiInjectorProvider` (UI injector) fails to initialize without Eclipse workbench. +2. **`FormatValidationTest` (5 failures, 1 error):** Assertion failures and a `ClassCastException` (`XMIResourceImpl` cannot be cast to `XtextResource`). +3. **`FormatParsingTest` (1 failure):** `loadModel` assertion failure. + +**Fix:** Run with `useUIHarness=true`. + +### `checkcfg.core.test` — 5 failures, 1 error (language registration + linking) + +1. **`CheckCfgScopeProviderTest` (1 error):** `Scope has no elements` — cannot find check catalogs. +2. **`CheckCfgSyntaxTest` (3 failures):** `unknown_language` + `Diagnostic.Linking` — the `com.avaloq.tools.ddk.check.TestLanguage` is not registered. +3. **`CheckCfgConfiguredParameterValidationsTest` (1 failure):** Same `unknown_language` issue. +4. **`CheckCfgTest` (1 failure):** `Expected no issues, but got: ERROR (unknown_language) 'Unknown language'`. + +**Fix:** Needs `useUIHarness=true` or explicit language registration in test setup. + +### `xtext.generator.test` — 2 errors (test setup bug) + +**`XbaseGeneratorFragmentTest`:** `testUsesXImportSectionWhenNotUsed` and `testUsesXImportSectionWhenUsed` — `NullPointerException` because the grammar rule is not attached to a resource. + +**Fix:** Genuine test setup bug. Needs investigation of fixture creation. + +## Detailed Failures + +### `test.ui.test` + +``` +SwtBotRadioTest.testSwtRadioButtonClick:65 — WidgetNotFoundException: Could not find widget matching: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH') +SwtBotRadioTest.testSWTRadioButtonClick:76 — WidgetNotFoundException: Could not find widget matching: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH') +DeChKeyboardLayoutTest.testDeChKeyboardLayout:39 — WidgetNotFoundException: Could not find menu bar for shell: Shell with text {Preferences} +``` + +### `check.core.test` + +All 63 errors share the same root cause: +``` +java.lang.RuntimeException: Failed to create injector for com.avaloq.tools.ddk.check.Check +Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors: +``` + +Affected test classes: +- `BasicModelTest` — 9 errors (all methods) +- `ProjectBasedTests` — 1 error +- `IssueCodeToLabelMapGenerationTest` — 1 error +- `BugDsl27Test` — 1 error +- `CheckScopingTest` — 1 error +- `IssueCodeValueTest` — 1 error +- `CheckFormattingTest` — 3 errors +- `CheckJavaValidatorUtilTest` — 13 errors +- Remaining ~34 errors follow the same pattern + +Note: `BugAig1314Test` (2 tests) PASSES — it does not depend on the UI injector. + +### `xtext.format.test` + +``` +FormatScopingTest.allGrammarsScoped:107 — NullPointerException: Cannot invoke "Grammar.getRules()" because "this.grammarC" is null +FormatScopingTest.ruleSelfScoped:152 — NullPointerException: "this.grammarA" is null +FormatScopingTest.assignmentScoped:129 — NullPointerException: "this.grammarA" is null +FormatScopingTest.groupScoped:158 — NullPointerException: "this.grammarA" is null +FormatScopingTest.ruleCallScoped:141 — NullPointerException: "this.grammarA" is null +FormatScopingTest.keywordScoped:113 — NullPointerException: "this.grammarA" is null + +FormatValidationTest.extendedGrammarCompatible — ClassCastException: XMIResourceImpl cannot be cast to XtextResource +FormatValidationTest.missingGrammarRuleOverride — assertion failure +FormatValidationTest.grammarRuleOverrideOK — assertion failure +FormatValidationTest.requiredRulesImplemented — assertion failure +FormatValidationTest.extendedGrammarCompatibleOK — assertion failure +FormatValidationTest.testNegativeACF1000 — assertion failure + +FormatParsingTest.loadModel — assertion failure +``` + +### `checkcfg.core.test` + +``` +CheckCfgScopeProviderTest.testCatalogsAreInCorrectPackage — java.lang.Exception: Scope has no elements + +CheckCfgSyntaxTest.testPropertiesOnAllLevels — Unexpected issue: 'unknown_language' + Diagnostic.Linking +CheckCfgSyntaxTest.testSyntax — Unexpected diagnostic: Diagnostic.Linking +CheckCfgSyntaxTest.testSyntaxConfiguredLanguage — Unexpected issue: 'unknown_language' + Diagnostic.Linking + +CheckCfgConfiguredParameterValidationsTest.testConfiguredParameterValues — Unexpected issue: 'unknown_language' + +CheckCfgTest.testValidLanguageOk — Expected no issues, but got: ERROR (unknown_language) 'Unknown language' +``` + +### `xtext.generator.test` + +``` +XbaseGeneratorFragmentTest.testUsesXImportSectionWhenNotUsed:162 — NullPointerException: Cannot invoke "Resource.getResourceSet()" because the return value of "AbstractRule.eResource()" is null +XbaseGeneratorFragmentTest.testUsesXImportSectionWhenUsed:180 — NullPointerException: Cannot invoke "Resource.getResourceSet()" because the return value of "AbstractRule.eResource()" is null +``` + +## Recommendations + +1. **Enable immediately** (4 modules, +125 tests): `xtext.export.test`, `typesystem.test`, `check.runtime.core.test`, `xtext.ui.test` +2. **Move to UI harness** (3 modules): `check.core.test`, `xtext.format.test`, `checkcfg.core.test` — misclassified as non-UI but depend on UI injectors +3. **Fix SWTBot setup** (1 module): `test.ui.test` — widget/dialog not found in headless CI +4. **Fix test setup bug** (1 module): `xtext.generator.test` — `XbaseGeneratorFragmentTest` has 2 errors +5. **No action needed** (2 modules): `check.ui.test`, `sample.helloworld.ui.test` — no test classes found From c6baf4835c8cb4d6ceaeb4e92618843ff954627c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 01:37:47 +0100 Subject: [PATCH 13/15] =?UTF-8?q?docs:=20fix=20test=20report=20=E2=80=94?= =?UTF-8?q?=20correct=20SKIPPED=20modules=20and=20totals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xtext.test, check.ui.test, and sample.helloworld.ui.test were all SKIPPED by Maven due to earlier failures, not actually executed. Corrected total from 327 to 253 tests. Removed incorrect "no tests found" claims for skipped UI modules. Co-Authored-By: Claude Opus 4.6 --- TEST-REPORT.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/TEST-REPORT.md b/TEST-REPORT.md index dea19a336..64b94c4e6 100644 --- a/TEST-REPORT.md +++ b/TEST-REPORT.md @@ -11,8 +11,8 @@ CI Run: https://github.com/dsldevkit/dsl-devkit/actions/runs/21770332592 | Module | Tests | Failures | Errors | Status | |--------|------:|:--------:|:------:|:------:| | `xtext.ui.test` | 40 | 0 | 0 | PASS | -| `check.ui.test` | 0 | 0 | 0 | PASS *(no tests found)* | -| `sample.helloworld.ui.test` | 0 | 0 | 0 | PASS *(no tests found)* | +| `check.ui.test` | — | — | — | SKIPPED | +| `sample.helloworld.ui.test` | — | — | — | SKIPPED | | `test.ui.test` | 4 | 0 | 3 | FAIL | ### Non-UI Test Modules (same as #1263) @@ -22,12 +22,14 @@ CI Run: https://github.com/dsldevkit/dsl-devkit/actions/runs/21770332592 | `xtext.export.test` | 14 | 0 | 0 | PASS | | `typesystem.test` | 55 | 0 | 0 | PASS | | `check.runtime.core.test` | 16 | 0 | 0 | PASS | -| `xtext.test` *(existing)* | 74 | 0 | 0 | PASS | +| `xtext.test` *(existing)* | — | — | — | SKIPPED | | `xtext.format.test` | 22 | 6 | 7 | FAIL | | `xtext.generator.test` | 27 | 0 | 2 | FAIL | | `checkcfg.core.test` | 10 | 5 | 1 | FAIL | | `check.core.test` | 65 | 0 | 63 | FAIL | -| **Total** | **327** | **11** | **76** | | +| **Total** | **253** | **11** | **76** | | + +> **Note:** `xtext.test`, `check.ui.test`, and `sample.helloworld.ui.test` were SKIPPED by Maven due to earlier module failures (`--fail-at-end` mode). `xtext.test` normally runs 74 tests and passes on `master`. `check.ui.test` and `sample.helloworld.ui.test` were not executed, so it is unknown whether they contain discoverable tests. ## Root Cause Analysis @@ -176,4 +178,4 @@ XbaseGeneratorFragmentTest.testUsesXImportSectionWhenUsed:180 — NullPointerExc 2. **Move to UI harness** (3 modules): `check.core.test`, `xtext.format.test`, `checkcfg.core.test` — misclassified as non-UI but depend on UI injectors 3. **Fix SWTBot setup** (1 module): `test.ui.test` — widget/dialog not found in headless CI 4. **Fix test setup bug** (1 module): `xtext.generator.test` — `XbaseGeneratorFragmentTest` has 2 errors -5. **No action needed** (2 modules): `check.ui.test`, `sample.helloworld.ui.test` — no test classes found +5. **Needs re-run** (2 modules): `check.ui.test`, `sample.helloworld.ui.test` — SKIPPED due to earlier failures, status unknown From 2aa2eedc91872b27998e0a1c740314b13801c7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 12:53:11 +0100 Subject: [PATCH 14/15] build: preserve xtend-gen .gitignore during clean --- ddk-parent/pom.xml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ddk-parent/pom.xml b/ddk-parent/pom.xml index 7fe92c0c4..5c1aee65f 100644 --- a/ddk-parent/pom.xml +++ b/ddk-parent/pom.xml @@ -369,16 +369,20 @@ maven-clean-plugin ${clean.version} - - - xtend-gen - - ** - - - - - + + + xtend-gen + + ** + + + .gitignore + **/.gitignore + + + + + From a452f0a4779f6a1392d16679da0ed74438e5f318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dinis=20Ferreira?= Date: Sat, 7 Feb 2026 12:53:16 +0100 Subject: [PATCH 15/15] build: align ddk-target classifier with target.platform --- ddk-target/pom.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ddk-target/pom.xml b/ddk-target/pom.xml index f1657b79d..7b487e3c0 100644 --- a/ddk-target/pom.xml +++ b/ddk-target/pom.xml @@ -24,16 +24,16 @@ - - ddk.target - target - dsl-sdk - - - - + + ddk.target + target + ${target.platform} + + + + - \ No newline at end of file +