public class org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile extends org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled
{
public void <init>()
{
org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile;
specialinvoke v.<org.finos.legend.pure.m.tests.AbstractPureTestWithCoreCompiled: void <init>()>();
return;
}
public static void setUp()
{
org.finos.legend.pure.m.execution.FunctionExecution v;
v = staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile: org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()>();
staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile: void setUpRuntime(org.finos.legend.pure.m.execution.FunctionExecution)>(v);
return;
}
public void testPathToElementProfile()
{
org.finos.legend.pure.m.coreinstance.CoreInstance[] v;
org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile v;
org.finos.legend.pure.m.execution.Console v, v;
java.lang.String v, v;
org.finos.legend.pure.m.execution.FunctionExecution v, v;
v := @this: org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile;
staticinvoke <org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile: void compileTestSource(java.lang.String)>("Class A::B::C::D::E\n{\n}\n\nClass A::B::C::K::D\n{\n}\n\nfunction test::findElement(path:String[1], separator:String[1]):PackageableElement[1]\n{\n    $path->split($separator)->fold({str:String[1], pkg:PackageableElement[1] | let p = $pkg->cast(@Package).children->filter(c | $c.name == $str);\n                                                                               if ($p->isEmpty(), | fail(| $path + \' is not a valid PackageableElement. Package \\\'\' + $str + \'\\\' not found\'); $p->toOne();, | $p->toOne());\n                                   }, ::)\n}\n\nfunction test::testProfile():Nil[0]\n{\n    print(\'A::B::C::K::D\'->test::findElement(\'::\')->profile(false).result, 1);\n}\n");
v = newarray (org.finos.legend.pure.m.coreinstance.CoreInstance)[0];
virtualinvoke v.<org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile: org.finos.legend.pure.m.coreinstance.CoreInstance execute(java.lang.String,org.finos.legend.pure.m.coreinstance.CoreInstance[])>("test::testProfile():Nil[0]", v);
v = <org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile: 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)>("\'\n################################################## Profiler report ##################################################\n       ##---------------------------- TreeStart\n       + 1 profile_T_m__Boolean_1__ProfileResult_1_\n       +     1 findElement_String_1__String_1__PackageableElement_1_\n       +         1 fold_T_MANY__Function_1__V_m__V_m_\n       +             1 split_String_1__String_1__String_MANY_\n       +             5 letFunction_String_1__T_m__T_m_\n       +                 5 filter_T_MANY__Function_1__T_MANY_\n       +                     5 children(P)\n       +                         5 cast_Any_m__T_1__T_m_\n       +                     9 equal_Any_MANY__Any_MANY__Boolean_1_\n       +                         9 name(P)\n       +             5 if_Boolean_1__Function_1__Function_1__T_m_\n       +                 5 isEmpty_Any_MANY__Boolean_1_\n       +                 5 toOne_T_MANY__T_1_\n       ##---------------------------- TreeEnd\n################################################## Finished Report ##################################################\n\'", v);
v = <org.finos.legend.pure.runtime.java.interpreted.function.base.tools.TestProfile: 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)>(1);
staticinvoke <org.junit.Assert: void assertEquals(java.lang.Object,java.lang.Object)>("D instance Class\n    classifierGenericType(Property):\n        Anonymous_StripedId instance GenericType\n            rawType(Property):\n                [X] Class instance Class\n            typeArguments(Property):\n                [>1] Anonymous_StripedId instance GenericType\n    generalizations(Property):\n        Anonymous_StripedId instance Generalization\n            general(Property):\n                [>1] Anonymous_StripedId instance GenericType\n            specific(Property):\n                [>1] D instance Class\n    name(Property):\n        D instance String\n    package(Property):\n        K instance Package\n            children(Property):\n                [>1] D instance Class\n            name(Property):\n                [>1] K instance String\n            package(Property):\n                [>1] C instance Package", v);
return;
}
protected static org.finos.legend.pure.m.execution.FunctionExecution getFunctionExecution()
{
org.finos.legend.pure.runtime.java.interpreted.FunctionExecutionInterpreted v;
v = new org.finos.legend.pure.runtime.java.interpreted.FunctionExecutionInterpreted;
specialinvoke v.<org.finos.legend.pure.runtime.java.interpreted.FunctionExecutionInterpreted: void <init>()>();
return v;
}
}