use of act.plugin.GenericPluginManager in project actframework by actframework.
the class AutoConfigPluginTest method before.
@Before
public void before() throws Exception {
setup();
resolverManager = new StringValueResolverManager(mockApp);
when(mockApp.resolverManager()).thenReturn(resolverManager);
injector = new GenieInjector(mockApp);
when(mockApp.injector()).thenReturn(injector);
GenericPluginManager pluginManager = mock(GenericPluginManager.class);
Field field = Act.class.getDeclaredField("pluginManager");
field.setAccessible(true);
field.set(null, pluginManager);
when(mockAppConfig.getIgnoreCase(argThat(new ContainsIgnoreCase(".int")))).thenReturn(intVal);
when(mockAppConfig.getIgnoreCase(argThat(new ContainsIgnoreCase(".long")))).thenReturn(longVal);
when(mockAppConfig.getIgnoreCase(argThat(new ContainsIgnoreCase(".bool")))).thenReturn(boolVal);
when(mockAppConfig.getIgnoreCase(argThat(new ContainsIgnoreCase(".str")))).thenReturn(stringVal);
when(mockAppConfig.getIgnoreCase(argThat(new ContainsIgnoreCase(".method")))).thenReturn(enumVal);
when(mockAppConfig.getIgnoreCase(argThat(new ContainsIgnoreCase(".list")))).thenReturn(intListVal);
}
use of act.plugin.GenericPluginManager 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("");
}
use of act.plugin.GenericPluginManager in project actframework by actframework.
the class Act method initPluginManager.
private static void initPluginManager() {
LOGGER.debug("initializing generic plugin manager ...");
pluginManager = new GenericPluginManager();
}
Aggregations