@@ -0,0 +1,2651 @@
+package io.cloudslang.lang.compiler.caching;%0A%0Aimport io.cloudslang.lang.compiler.SlangSource;%0Aimport io.cloudslang.lang.compiler.modeller.model.Executable;%0Aimport io.cloudslang.lang.compiler.modeller.result.ExecutableModellingResult;%0Aimport java.util.ArrayList;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.mock;%0A%0A/**%0A * @author Bonczidai Levente%0A * @since 11/13/2016%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes = CachedPrecompileServiceImplTest.Config.class)%0Apublic class CachedPrecompileServiceImplTest %7B%0A%0A    @Autowired%0A    private CachedPrecompileService cachedPrecompileService;%0A%0A    @Test%0A    public void testBasicSanity() throws Exception %7B%0A        String path = %22path_1%22;%0A        Executable executableMock = mock(Executable.class);%0A        ExecutableModellingResult executableModellingResult =%0A                new ExecutableModellingResult(executableMock, new ArrayList%3CRuntimeException%3E());%0A        SlangSource slangSource_1 = new SlangSource(%22abc%22, %22one%22);%0A        SlangSource slangSource_2 = new SlangSource(%22def%22, %22two%22);%0A%0A        CacheResult cacheResult;%0A%0A        cacheResult = cachedPrecompileService.getValueFromCache(path, slangSource_1);%0A        assertEquals(CacheValueState.MISSING, cacheResult.getState());%0A%0A        cachedPrecompileService.cacheValue(path, executableModellingResult, slangSource_1);%0A        cacheResult = cachedPrecompileService.getValueFromCache(path, slangSource_1);%0A        assertEquals(CacheValueState.VALID, cacheResult.getState());%0A%0A        cacheResult = cachedPrecompileService.getValueFromCache(path, slangSource_2);%0A        assertEquals(CacheValueState.OUTDATED, cacheResult.getState());%0A%0A        cachedPrecompileService.cacheValue(path, executableModellingResult, slangSource_2);%0A        cacheResult = cachedPrecompileService.getValueFromCache(path, slangSource_2);%0A        assertEquals(CacheValueState.VALID, cacheResult.getState());%0A%0A        cachedPrecompileService.invalidateAll();%0A        cacheResult = cachedPrecompileService.getValueFromCache(path, slangSource_2);%0A        assertEquals(CacheValueState.MISSING, cacheResult.getState());%0A    %7D%0A%0A    public static class Config %7B%0A        @Bean%0A        public CachedPrecompileService cachedPrecompileService() %7B%0A            return new CachedPrecompileServiceImpl();%0A        %7D%0A    %7D%0A%0A%7D

make precompile caching sateless - add test