Search in sources :

Example 1 with SightlyEngineConfiguration

use of org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration 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)

Example 2 with SightlyEngineConfiguration

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

the class SourceIdentifierTest method getSourceIdentifier.

private SourceIdentifier getSourceIdentifier(String path) {
    Resource resource = mock(Resource.class);
    when(resource.getPath()).thenReturn(path);
    SightlyEngineConfiguration configuration = mock(SightlyEngineConfiguration.class);
    when(configuration.getBundleSymbolicName()).thenReturn(BUNDLE_SYMBOLIC_NAME);
    return new SourceIdentifier(configuration, resource.getPath());
}
Also used : SightlyEngineConfiguration(org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration) Resource(org.apache.sling.api.resource.Resource)

Aggregations

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