-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3261 from LorenzoBettini/lb_3258
Cleanup tests using Java records
- Loading branch information
Showing
13 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
org.eclipse.xtend.core.tests/testdata/test/SomeRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Lorenzo Bettini and others. | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package test; | ||
|
||
/** | ||
* @author Lorenzo Bettini - Initial contribution and API | ||
*/ | ||
public record SomeRecord() { | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...tend.maven.plugin/src/test/resources/it/compile/simple/src/main/java/test/JavaRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package test; | ||
|
||
public record JavaRecord(String name) { | ||
public XtendA foo(XtendA test) { | ||
return test; | ||
} | ||
} |
9 changes: 6 additions & 3 deletions
9
...e.xtend.maven.plugin/src/test/resources/it/compile/simple/src/main/java/test/XtendA.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package test | ||
|
||
class XtendA extends JavaB { | ||
|
||
def JavaB test2(XtendC s) { | ||
return s.foo.newJavaB | ||
} | ||
|
||
def JavaB newJavaB() { | ||
return new JavaB() | ||
} | ||
|
||
|
||
def JavaRecord newJavaRecord() { | ||
return new JavaRecord("a test") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...se.xtext.maven.plugin/src/test/resources/it/generate/java-lang-bi-ref/src/JavaRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public record JavaRecord(String name) { | ||
public void useXbaseType(XbaseReferToJava xbaseType) throws Throwable { | ||
xbaseType.myMethod(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...t.maven.plugin/src/test/resources/it/generate/java-lang-bi-ref/src/XbaseReferToJava.xbase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
val JavaClazz jc = null | ||
val JavaRecord jr = new JavaRecord("test") | ||
val name = jr.name() | ||
jc.useXbaseType(this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
org.eclipse.xtext.xbase.tests/testdata/test/RecordWithFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Lorenzo Bettini and others. | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package test; | ||
|
||
/** | ||
* @author Lorenzo Bettini - Initial contribution and API | ||
*/ | ||
public record RecordWithFields(int begin, int end) { | ||
|
||
} |