Skip to content

Commit

Permalink
Merge branch 'main' into carstenartur-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur authored Nov 17, 2024
2 parents 7932f3f + 9cc4f0f commit bc303ff
Show file tree
Hide file tree
Showing 31 changed files with 280 additions and 912 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@97bf5df3c09e75f5bcd72695998f96ebd701846e
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ jobs:
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: maven

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
Binary file modified artifacts.jar
Binary file not shown.
Binary file modified content.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added plugins/sandbox_common_1.2.0.202411171602.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added plugins/sandbox_tools_1.2.0.202411171602.jar
Binary file not shown.
Binary file added plugins/sandbox_usage_view_1.2.0.202411171602.jar
Binary file not shown.
Binary file not shown.
5 changes: 4 additions & 1 deletion sandbox_junit_cleanup/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jface,
org.eclipse.ui.workbench,
org.eclipse.jdt.core.manipulation,
sandbox_common
sandbox_common,
org.junit,
org.eclipse.jdt.junit.runtime,
org.eclipse.jdt.junit4.runtime
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: org.eclipse.jdt.core.manipulation
Import-Package: org.sandbox.jdt.internal.common,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,32 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.junit.JUnitCore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.sandbox.jdt.internal.corext.fix2.MYCleanUpConstants;
import org.sandbox.jdt.ui.tests.quickfix.rules.AbstractEclipseJava;
import org.sandbox.jdt.ui.tests.quickfix.rules.EclipseJava8;
import org.sandbox.jdt.ui.tests.quickfix.rules.EclipseJava17;


public class JUnitMigrationCleanUpTest {

@RegisterExtension
AbstractEclipseJava context4junit4= new EclipseJava8();
AbstractEclipseJava context4junit4= new EclipseJava17();

@RegisterExtension
AbstractEclipseJava context4junit5= new EclipseJava8();
AbstractEclipseJava context4junit5= new EclipseJava17();

IPackageFragmentRoot fRootJUnit4;
IPackageFragmentRoot fRootJUnit5;

@BeforeEach
public void setup() throws CoreException {
fRootJUnit4= context4junit4.createClasspathForJUnit("4");
fRootJUnit5= context4junit5.createClasspathForJUnit("5");
fRootJUnit4= context4junit4.createClasspathForJUnit(JUnitCore.JUNIT4_CONTAINER_PATH);
fRootJUnit5= context4junit5.createClasspathForJUnit(JUnitCore.JUNIT5_CONTAINER_PATH);
}

enum JUnitCleanupCases{
Expand Down Expand Up @@ -801,8 +802,21 @@ public void test3() throws IOException{
@EnumSource(JUnitCleanupCases.class)
public void testJUnitCleanupParametrized(JUnitCleanupCases test) throws CoreException {
IPackageFragment pack= fRootJUnit4.createPackageFragment("test", true, null);
ICompilationUnit cu= pack.createCompilationUnit("MyTest.java", test.given, false, null); //$NON-NLS-1$
ICompilationUnit cu= pack.createCompilationUnit("MyTest.java", test.given, true, null); //$NON-NLS-1$
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSERT);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSUME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_SUITE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORECLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTERCLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_IGNORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_TEST);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETEMPORARYFOLDER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETESTNAME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_EXTERNALRESOURCE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RUNWITH);
context4junit4.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
}

Expand Down Expand Up @@ -902,6 +916,19 @@ public start(){
}
""", false, null); //$NON-NLS-1$
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSERT);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSUME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_SUITE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORECLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTERCLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_IGNORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_TEST);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETEMPORARYFOLDER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETESTNAME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_EXTERNALRESOURCE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RUNWITH);
context4junit4.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu,cu2}, new String[] {
"""
package test;
Expand Down Expand Up @@ -989,6 +1016,19 @@ public start(){
}
""", false, null); //$NON-NLS-1$
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSERT);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSUME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_SUITE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORECLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTERCLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_IGNORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_TEST);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETEMPORARYFOLDER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETESTNAME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_EXTERNALRESOURCE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RUNWITH);
context4junit4.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu,cu2}, new String[] {
"""
package test;
Expand Down Expand Up @@ -1082,6 +1122,19 @@ protected void after() {
}
""", false, null); //$NON-NLS-1$
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSERT);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_ASSUME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_SUITE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_BEFORECLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_AFTERCLASS);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_IGNORE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_TEST);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETEMPORARYFOLDER);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RULETESTNAME);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_EXTERNALRESOURCE);
context4junit4.enable(MYCleanUpConstants.JUNIT_CLEANUP_4_RUNWITH);
context4junit4.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu,cu2,cu3}, new String[] {
"""
package test;
Expand Down
Binary file not shown.
Loading

0 comments on commit bc303ff

Please sign in to comment.