use of com.vaadin.flow.server.MockServletServiceSessionSetup.TestVaadinServlet in project flow by vaadin.
the class BootstrapHandlerDependenciesTest method setup.
@Before
public void setup() throws Exception {
mocks = new MockServletServiceSessionSetup();
service = mocks.getService();
service.setRouter(createRouter());
TestVaadinServlet servlet = mocks.getServlet();
for (String type : new String[] { "js", "css" }) {
servlet.addServletContextResource("inline." + type, "inline." + type);
servlet.addServletContextResource("1." + type, "1." + type);
servlet.addServletContextResource("2." + type, "2." + type);
}
servlet.addServletContextResource("new.js");
ResourceProvider resourceProvider = service.getContext().getAttribute(Lookup.class).lookup(ResourceProvider.class);
InputStream stream = resourceProvider.getClientResourceAsStream("META-INF/resources/" + ApplicationConstants.CLIENT_ENGINE_PATH + "/compile.properties");
Properties properties = new Properties();
properties.load(stream);
clientEngine = ApplicationConstants.CLIENT_ENGINE_PATH + "/" + properties.getProperty("jsFile");
stream.close();
}
Aggregations