Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public abstract class AbstractCheckTestCase {
private Provider<XtextResourceSet> resourceSetProvider;

@BeforeEach
public void setUp() throws Exception {
void setUp() throws Exception {
getInjector().injectMembers(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@ExtendWith(InjectionExtension.class)
@InjectWith(CheckInjectorProvider.class)
@SuppressWarnings("nls")
public class BugAig1314 {
class BugAig1314Test {

/** Constructor of super class is protected... */
private static class TestScope extends CatalogFromExtensionPointScope {
Expand Down Expand Up @@ -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);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
@InjectWith(CheckInjectorProvider.class)
@ExtendWith(InjectionExtension.class)
@SuppressWarnings("nls")
public 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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,20 @@
*******************************************************************************/
package com.avaloq.tools.ddk.check.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.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 {
@IncludeClassNamePatterns(".*Test.*")
class CheckCoreTestSuite {

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
* 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";
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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@
*******************************************************************************/
package com.avaloq.tools.ddk.check.test.runtime.tests;

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.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 {
@IncludeClassNamePatterns(".*Test.*")
class CheckExecutionEnvironmentTestSuite {

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@

package com.avaloq.tools.ddk.check.test.runtime.tests;

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.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 {
@IncludeClassNamePatterns(".*Test.*")
class CheckLibraryChecksTestSuite {

}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -121,7 +121,7 @@ protected void execute(final IProgressMonitor monitor) throws CoreException, Inv
* </p>
*/
@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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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();

Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();

Expand All @@ -236,7 +236,7 @@ public void testCatalogNameDiscouraged() {
* Tests valid catalog names.
*/
@Test
public void testCatalogName() {
void testCatalogName() {
selectProjectFolder(wizard, VALID_PACKAGE_NAME);
initializeWizardBot();

Expand All @@ -249,7 +249,7 @@ public 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();

Expand All @@ -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());
}
Expand Down
Loading