public class org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled extends org.finos.legend.pure.m.tests.function.base.lang.AbstractTestNewAtRuntime
{
public void <init>()
{
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled;
specialinvoke v.<org.finos.legend.pure.m.tests.function.base.lang.AbstractTestNewAtRuntime: void <init>()>();
return;
}
public static void setUp()
{
org.finos.legend.pure.m.serialization.filesystem.usercodestorage.MutableRepositoryCodeStorage v;
org.finos.legend.pure.m.coreinstance.CoreInstanceFactoryRegistry v;
org.finos.legend.pure.m.execution.FunctionExecution v;
v = staticinvoke <org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled: org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()>();
v = staticinvoke <org.finos.legend.pure.m.tests.function.base.lang.AbstractTestNewAtRuntime: org.finos.legend.pure.m.serialization.filesystem.usercodestorage.MutableRepositoryCodeStorage getCodeStorage()>();
v = staticinvoke <org.finos.legend.pure.runtime.java.compiled.factory.JavaModelFactoryRegistryLoader: org.finos.legend.pure.m.coreinstance.CoreInstanceFactoryRegistry loader()>();
staticinvoke <org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: void setUpRuntime(org.finos.legend.pure.m.execution.FunctionExecution,org.finos.legend.pure.m.serialization.filesystem.usercodestorage.MutableRepositoryCodeStorage,org.finos.legend.pure.m.coreinstance.CoreInstanceFactoryRegistry)>(v, v, v);
return;
}
public static org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()
{
org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiled v;
org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder v;
v = new org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder;
specialinvoke v.<org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder: void <init>()>();
v = virtualinvoke v.<org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder: org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiled build()>();
return v;
}
protected void assertNewNilException(java.lang.Exception)
{
java.lang.Exception v;
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled;
v := @parameter: java.lang.Exception;
virtualinvoke v.<org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled: void assertOriginatingPureException(java.lang.Class,java.lang.String,java.lang.Exception)>(class "Lorg/finos/legend/pure/m3/exception/PureExecutionException;", "Cannot instantiate meta::pure::metamodel::type::Nil", v);
return;
}
public void testNewWithInheritenceAndOverriddenAssociationEndWithReverseOneToOneProperty()
{
org.finos.legend.pure.m.coreinstance.CoreInstance[] v;
org.finos.legend.pure.m.execution.Console v;
java.lang.String v;
java.lang.Exception v;
org.finos.legend.pure.m.execution.FunctionExecution v;
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled;
staticinvoke <org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "function test(): Any[*]\n{\n   let car = ^test::FastCar(name=\'Bugatti\', owner= ^test::Owner(firstName=\'John\', lastName=\'Roe\'));\n   print($car.owner.car->size()->toString(), 1);\n   $car;}\n\nClass\ntest::Car\n{\n   name : String[1];\n}\n\nClass\ntest::FastCar extends test::Car\n{\n   owner : test::Owner[1];\n}\nClass\ntest::Owner\n{\n   firstName: String[1];\n   lastName: String[1];\n}\n\nAssociation test::Car_Owner\n{\n   owner : test::Owner[1];\n   car  : test::Car[1];\n}");
label:
v = newarray (org.finos.legend.pure.m.coreinstance.CoreInstance)[0];
virtualinvoke v.<org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled: org.finos.legend.pure.m.coreinstance.CoreInstance execute(java.lang.String,org.finos.legend.pure.m.coreinstance.CoreInstance[])>("test():Any[*]", v);
v = <org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: org.finos.legend.pure.m.execution.FunctionExecution functionExecution>;
v = interfaceinvoke v.<org.finos.legend.pure.m.execution.FunctionExecution: org.finos.legend.pure.m.execution.Console getConsole()>();
v = interfaceinvoke v.<org.finos.legend.pure.m.execution.Console: java.lang.String getLine(int)>(0);
staticinvoke <org.junit.Assert: void assertEquals(java.lang.Object,java.lang.Object)>("\'0\'", v);
label:
goto label;
label:
v := @caughtexception;
staticinvoke <org.junit.Assert: void fail(java.lang.String)>("Failed to set the reverse properties for a one-to-one association.");
label:
return;
catch java.lang.Exception from label to label with label;
}
public void testNewWithInheritenceAndOverriddenAssociationEndWithReverseOneToManyProperty()
{
org.finos.legend.pure.m.coreinstance.CoreInstance[] v;
org.finos.legend.pure.m.execution.Console v;
java.lang.String v;
java.lang.Exception v;
org.finos.legend.pure.m.execution.FunctionExecution v;
org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled v;
v := @this: org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled;
staticinvoke <org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: org.finos.legend.pure.m.SourceMutation compileTestSource(java.lang.String,java.lang.String)>("fromString.pure", "function test(): Any[*]\n{\n   let car = ^test::FastCar(name=\'Bugatti\', owner= ^test::Owner(firstName=\'John\', lastName=\'Roe\'));\n   print($car.owner.cars->size()->toString(), 1);\n   $car;}\n\nClass\ntest::Car\n{\n   name : String[1];\n}\n\nClass\ntest::FastCar extends test::Car\n{\n   owner : test::Owner[1];\n}\nClass\ntest::Owner\n{\n   firstName: String[1];\n   lastName: String[1];\n}\n\nAssociation test::Car_Owner\n{\n   owner : test::Owner[1];\n   cars  : test::Car[1..*];\n}");
label:
v = newarray (org.finos.legend.pure.m.coreinstance.CoreInstance)[0];
virtualinvoke v.<org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.base.lang.TestNewCompiled: org.finos.legend.pure.m.coreinstance.CoreInstance execute(java.lang.String,org.finos.legend.pure.m.coreinstance.CoreInstance[])>("test():Any[*]", v);
v = <org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: org.finos.legend.pure.m.execution.FunctionExecution functionExecution>;
v = interfaceinvoke v.<org.finos.legend.pure.m.execution.FunctionExecution: org.finos.legend.pure.m.execution.Console getConsole()>();
v = interfaceinvoke v.<org.finos.legend.pure.m.execution.Console: java.lang.String getLine(int)>(0);
staticinvoke <org.junit.Assert: void assertEquals(java.lang.Object,java.lang.Object)>("\'0\'", v);
label:
goto label;
label:
v := @caughtexception;
staticinvoke <org.junit.Assert: void fail(java.lang.String)>("Failed to set the reverse properties for a one-to-one association.");
label:
return;
catch java.lang.Exception from label to label with label;
}
}