Search in sources :

Example 1 with SightlyJavaCompilerService

use of org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService in project sling by apache.

the class SightlyJavaCompilerServiceTest method setUp.

@Before
public void setUp() throws Exception {
    compiler = spy(new SightlyJavaCompilerService());
    resourceBackedPojoChangeMonitor = spy(new ResourceBackedPojoChangeMonitor());
    SightlyEngineConfiguration sightlyEngineConfiguration = mock(SightlyEngineConfiguration.class);
    when(sightlyEngineConfiguration.getBundleSymbolicName()).thenReturn("org.apache.sling.scripting.sightly");
    when(sightlyEngineConfiguration.getScratchFolder()).thenReturn("/org/apache/sling/scripting/sightly");
    Whitebox.setInternalState(compiler, "sightlyEngineConfiguration", sightlyEngineConfiguration);
    Whitebox.setInternalState(compiler, "resourceBackedPojoChangeMonitor", resourceBackedPojoChangeMonitor);
    classLoaderWriter = Mockito.mock(ClassLoaderWriter.class);
    ClassLoader classLoader = Mockito.mock(ClassLoader.class);
    when(classLoaderWriter.getClassLoader()).thenReturn(classLoader);
}
Also used : ClassLoaderWriter(org.apache.sling.commons.classloader.ClassLoaderWriter) SightlyEngineConfiguration(org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration) ResourceBackedPojoChangeMonitor(org.apache.sling.scripting.sightly.impl.engine.ResourceBackedPojoChangeMonitor) SightlyJavaCompilerService(org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService) Before(org.junit.Before)

Aggregations

ClassLoaderWriter (org.apache.sling.commons.classloader.ClassLoaderWriter)1 ResourceBackedPojoChangeMonitor (org.apache.sling.scripting.sightly.impl.engine.ResourceBackedPojoChangeMonitor)1 SightlyEngineConfiguration (org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration)1 SightlyJavaCompilerService (org.apache.sling.scripting.sightly.impl.engine.SightlyJavaCompilerService)1 Before (org.junit.Before)1