Skip to content

Commit

Permalink
Update Java 22 tests
Browse files Browse the repository at this point in the history
Signed-off-by: Snjezana Peco <[email protected]>
  • Loading branch information
snjeza committed Mar 26, 2024
1 parent 25d7a0b commit 1781d55
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.jdt.ls.target/org.eclipse.jdt.ls.tp.target
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<unit id="org.eclipse.jdt.core.compiler.batch" version="0.0.0"/>
<unit id="org.eclipse.jdt.core" version="0.0.0"/>
<unit id="org.eclipse.jdt.apt.core" version="0.0.0"/>
<repository location="https://download.eclipse.org/eclipse/updates/4.32-I-builds/I20240325-1800/"/>
<repository location="https://download.eclipse.org/jdtls/jdt-core-incubator/snapshots/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtext.xbase.lib" version="0.0.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
/**
* It's a Foo class
*/
public sealed interface Foo
permits Bar {
public class Foo {
public Foo() {
System.out.println();
super();
}
}
record Bar(String name) implements Foo { }
Original file line number Diff line number Diff line change
Expand Up @@ -1203,11 +1203,9 @@ public void testClassExtendFinalClass() throws Exception {

@Test
public void testAddSealedMissingClassModifierProposal() throws Exception {
Map<String, String> options22 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
fJProject.setOptions(options22);
Map<String, String> options17 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
fJProject.setOptions(options17);
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test", false, null);
assertNoErrors(fJProject.getResource());

Expand Down Expand Up @@ -1250,11 +1248,9 @@ public void testAddSealedMissingClassModifierProposal() throws Exception {

@Test
public void testAddSealedAsDirectSuperClass() throws Exception {
Map<String, String> options22 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
fJProject.setOptions(options22);
Map<String, String> options17 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
fJProject.setOptions(options17);
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test", false, null);
assertNoErrors(fJProject.getResource());

Expand All @@ -1279,11 +1275,9 @@ public void testAddSealedAsDirectSuperClass() throws Exception {

@Test
public void testAddPermitsToDirectSuperClass() throws Exception {
Map<String, String> options22 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
fJProject.setOptions(options22);
Map<String, String> options17 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
fJProject.setOptions(options17);
IPackageFragment pack1 = fSourceFolder.createPackageFragment("test", false, null);
assertNoErrors(fJProject.getResource());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1492,11 +1492,9 @@ public void testDontImportTestClassesInMainCode() throws Exception {

@Test
public void testTypeInSealedTypeDeclaration() throws Exception {
Map<String, String> options22 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options22, JavaCore.VERSION_22);
options22.put(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED);
options22.put(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE);
fJProject1.setOptions(options22);
Map<String, String> options17 = new HashMap<>();
JavaModelUtil.setComplianceOptions(options17, JavaCore.VERSION_17);
fJProject1.setOptions(options17);

IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
StringBuilder buf = new StringBuilder();
Expand Down

0 comments on commit 1781d55

Please sign in to comment.