use of play.plugins.PluginCollection in project actframework by actframework.
the class RouterBenchmark method prepare.
@BeforeClass
public static void prepare() {
try {
Field f = Act.class.getDeclaredField("pluginManager");
f.setAccessible(true);
f.set(null, new GenericPluginManager());
} catch (Exception e) {
throw E.unexpected(e);
}
app = App.testInstance();
config = app.config();
RequestHandlerResolver controllerLookup = new MockRequestHandlerResolver();
router = new Router(controllerLookup, app);
InputStream is = TestBase.class.getResourceAsStream("/routes");
String fc = IO.readContentAsString(is);
builder = new RouteTableRouterBuilder(fc.split("[\r\n]+"));
builder.build(router);
Play.pluginCollection = new PluginCollection();
URL url = TestBase.class.getResource("/routes");
Play.applicationPath = new File(FastStr.of(url.getPath()).beforeLast('/').toString());
Play.routes = VirtualFile.fromRelativePath("routes");
play.mvc.Router.load("");
}
Aggregations