Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regen examples #405

Merged
merged 1 commit into from
Feb 21, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,29 @@ class CompilerTest {
]
}

@Test def void testGeneratedJavaInheritedMethod() throws Exception {
#[
'''
entity Foo extends Bar {
// getName and setName inherited from Bar
op doStuff(String x) : String {
return x + ' ' + getName()
}
}
''',
'''
entity Bar {
name : String
}
'''
].compile [
val fooObj = it.getCompiledClass("Foo").getDeclaredConstructor().newInstance
fooObj.invoke('setName', 'World')
assertEquals("Hello World", fooObj.invoke('doStuff','Hello'))
]
}


@Test def void compareGeneratedJava() throws Exception {
'''
entity Foo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Require-Bundle: org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
org.eclipse.xtend.lib;bundle-version="2.14.0",
org.eclipse.xtext,
org.eclipse.xtext.common.types,
org.eclipse.xtext.util,
org.eclipse.xtext.xbase,
org.eclipse.xtext.xbase.lib;bundle-version="2.14.0",
org.objectweb.asm;bundle-version="[9.6.0,9.7.0)";resolution:=optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class DomainmodelJvmModelInferrer extends AbstractModelInferrer {
def dispatch infer(Entity entity, extension IJvmDeclaredTypeAcceptor acceptor, boolean prelinkingPhase) {
accept(entity.toClass( entity.fullyQualifiedName )) [
documentation = entity.documentation
if (entity.superType !== null)
superTypes += entity.superType.cloneWithProxies
superClass = entity.superType

// let's add a default constructor
members += entity.toConstructor []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<unit id="org.junit" version="4.13.2.v20230809-1000"/>
<unit id="org.hamcrest" version="2.2.0"/>
<unit id="org.hamcrest.core" version="2.2.0.v20230809-1000"/>
<unit id="org.apache.commons.logging" version="1.2.0"/>
<unit id="org.apiguardian.api" version="0.0.0"/>
<unit id="junit-jupiter-api" version="0.0.0"/>
<unit id="junit-jupiter-engine" version="0.0.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<unit id="org.junit" version="4.13.2.v20230809-1000"/>
<unit id="org.hamcrest" version="2.2.0"/>
<unit id="org.hamcrest.core" version="2.2.0.v20230809-1000"/>
<unit id="org.apache.commons.logging" version="1.2.0"/>
<unit id="org.apiguardian.api" version="0.0.0"/>
<unit id="junit-jupiter-api" version="0.0.0"/>
<unit id="junit-jupiter-engine" version="0.0.0"/>
Expand Down
Loading