Search in sources :

Example 1 with MemoryGraphLoaderPureGraphCache

use of org.finos.legend.pure.m3.serialization.runtime.cache.MemoryGraphLoaderPureGraphCache in project legend-pure by finos.

the class TestGraphIsSerialized method testInitializedFromGraphLoaderSerialization.

@Test
public void testInitializedFromGraphLoaderSerialization() {
    PureRuntime runtime = new PureRuntimeBuilder(getCodeStorage()).buildAndInitialize();
    PureGraphCache cache = new MemoryGraphLoaderPureGraphCache();
    cache.setPureRuntime(runtime);
    cache.cacheRepoAndSources();
    runtime = new PureRuntimeBuilder(getCodeStorage()).withCache(cache).buildAndTryToInitializeFromCache();
    new FunctionExecutionCompiledBuilder().build().init(runtime, new Message(""));
    Assert.assertTrue(cache.getCacheState().getLastStackTrace(), runtime.isInitialized());
    assertAllInstancesMarkedSerialized(runtime);
}
Also used : PureRuntime(org.finos.legend.pure.m3.serialization.runtime.PureRuntime) FunctionExecutionCompiledBuilder(org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder) Message(org.finos.legend.pure.m3.serialization.runtime.Message) PureRuntimeBuilder(org.finos.legend.pure.m3.serialization.runtime.PureRuntimeBuilder) PureGraphCache(org.finos.legend.pure.m3.serialization.runtime.cache.PureGraphCache) MemoryPureGraphCache(org.finos.legend.pure.m3.serialization.runtime.cache.MemoryPureGraphCache) MemoryGraphLoaderPureGraphCache(org.finos.legend.pure.m3.serialization.runtime.cache.MemoryGraphLoaderPureGraphCache) MemoryGraphLoaderPureGraphCache(org.finos.legend.pure.m3.serialization.runtime.cache.MemoryGraphLoaderPureGraphCache) Test(org.junit.Test)

Aggregations

Message (org.finos.legend.pure.m3.serialization.runtime.Message)1 PureRuntime (org.finos.legend.pure.m3.serialization.runtime.PureRuntime)1 PureRuntimeBuilder (org.finos.legend.pure.m3.serialization.runtime.PureRuntimeBuilder)1 MemoryGraphLoaderPureGraphCache (org.finos.legend.pure.m3.serialization.runtime.cache.MemoryGraphLoaderPureGraphCache)1 MemoryPureGraphCache (org.finos.legend.pure.m3.serialization.runtime.cache.MemoryPureGraphCache)1 PureGraphCache (org.finos.legend.pure.m3.serialization.runtime.cache.PureGraphCache)1 FunctionExecutionCompiledBuilder (org.finos.legend.pure.runtime.java.compiled.execution.FunctionExecutionCompiledBuilder)1 Test (org.junit.Test)1