Skip to content

Commit

Permalink
plugins ITs: Java records are also in standard test projects
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Nov 28, 2024
1 parent 5421f4e commit 49a4a9b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
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;
}
}
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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public void javaLangBiRef() throws Exception {
verifier.verifyFilePresent(verifier.getBasedir() + "/src-gen/XbaseReferToJava.java");
verifier.verifyFilePresent(verifier.getBasedir() + "/target/xtext-temp/stub-classes/XbaseReferToJava.class");
verifier.verifyFilePresent(verifier.getBasedir() + "/target/xtext-temp/stub-classes/JavaClazz.class");
verifier.verifyFilePresent(verifier.getBasedir() + "/target/xtext-temp/stub-classes/JavaRecord.class");
}

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

0 comments on commit 49a4a9b

Please sign in to comment.