use of org.xwiki.environment.internal.ServletEnvironment in project xwiki-platform by xwiki.
the class AbstractFilesystemAttachmentStoreTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
Utils.setComponentManager(this.getComponentManager());
final ServletEnvironment environment = (ServletEnvironment) this.getComponentManager().getInstance(Environment.class);
final ServletContext mockServletContext = this.getMockery().mock(ServletContext.class);
environment.setServletContext(mockServletContext);
this.getMockery().checking(new Expectations() {
{
allowing(mockServletContext).getAttribute("javax.servlet.context.tempdir");
will(returnValue(new File(System.getProperty("java.io.tmpdir"))));
allowing(mockServletContext).getResource("/WEB-INF/xwiki.properties");
will(returnValue(null));
}
});
}
Aggregations