use of act.app.TestingAppClassLoader in project actframework by actframework.
the class MetricEnhancerTest method setup.
@Before
public void setup() throws Exception {
super.setup();
repo = Mockito.mock(MetricMetaInfoRepo.class);
base = new File("./target/test-classes");
when(mockApp.classLoader()).thenReturn(classLoader);
classLoader = new TestingAppClassLoader(mockApp);
}
use of act.app.TestingAppClassLoader in project actframework by actframework.
the class ControllerByteCodeScannerTest method setup.
@Before
public void setup() throws Exception {
super.setup();
controllerScanner = new ControllerByteCodeScanner();
jobScanner = new JobByteCodeScanner();
scannerManager = mock(AppCodeScannerManager.class);
classInfoRepository = mock(ClassInfoRepository.class);
eventBus = mock(EventBus.class);
when(mockApp.eventBus()).thenReturn(eventBus);
jobManager = new JobManager(mockApp);
classLoader = new TestingAppClassLoader(mockApp);
$.setProperty(classLoader, classInfoRepository, "classInfoRepository");
when(mockApp.classLoader()).thenReturn(classLoader);
infoSrc = classLoader.controllerClassMetaInfoManager();
when(mockApp.classLoader()).thenReturn(classLoader);
when(mockApp.scannerManager()).thenReturn(scannerManager);
when(mockApp.jobManager()).thenReturn(jobManager);
when(mockAppConfig.possibleControllerClass(anyString())).thenReturn(true);
when(mockRouter.isActionMethod(anyString(), anyString())).thenReturn(false);
C.List<AppByteCodeScanner> scanners = $.cast(C.listOf(controllerScanner, jobScanner));
// C.List<AppByteCodeScanner> scanners = C.list(controllerScanner);
when(scannerManager.byteCodeScanners()).thenReturn(scanners);
paramValueLoaderManager = mock(ParamValueLoaderManager.class);
when(mockApp.service(ParamValueLoaderManager.class)).thenReturn(paramValueLoaderManager);
controllerScanner.setApp(mockApp);
jobScanner.setApp(mockApp);
base = new File("./target/test-classes");
}
use of act.app.TestingAppClassLoader in project actframework by actframework.
the class ControllerEnhancerTest method setup.
@Before
public void setup() throws Exception {
super.setup();
invokeLog = mock(InvokeLog.class);
scanner = new ControllerByteCodeScanner();
scanner.setApp(mockApp);
eventBus = mock(EventBus.class);
classLoader = new TestingAppClassLoader(mockApp);
classInfoRepository = mock(ClassInfoRepository.class);
$.setProperty(classLoader, classInfoRepository, "classInfoRepository");
infoSrc = classLoader.controllerClassMetaInfoManager();
scannerManager = mock(AppCodeScannerManager.class);
when(mockApp.classLoader()).thenReturn(classLoader);
when(mockApp.scannerManager()).thenReturn(scannerManager);
when(mockApp.eventBus()).thenReturn(eventBus);
when(mockAppConfig.possibleControllerClass(anyString())).thenReturn(true);
when(mockRouter.isActionMethod(anyString(), anyString())).thenReturn(false);
C.List<AppByteCodeScanner> scanners = C.list(scanner);
when(scannerManager.byteCodeScanners()).thenReturn(scanners);
InvokeLogFactory.set(invokeLog);
ActionContext.clearCurrent();
ctx = ActionContext.create(mockApp, mockReq, mockResp);
ctx.saveLocal();
base = new File("./target/test-classes");
}
use of act.app.TestingAppClassLoader in project actframework by actframework.
the class MailerEnhancerTest method setup.
@Before
public void setup() throws Exception {
super.setup();
invokeLog = mock(InvokeLog.class);
scanner = new MailerByteCodeScanner();
scanner.setApp(mockApp);
classLoader = new TestingAppClassLoader(mockApp);
infoSrc = classLoader.mailerClassMetaInfoManager();
scannerManager = mock(AppCodeScannerManager.class);
when(mockApp.classLoader()).thenReturn(classLoader);
when(mockApp.scannerManager()).thenReturn(scannerManager);
C.List<AppByteCodeScanner> scanners = C.list(scanner);
when(scannerManager.byteCodeScanners()).thenReturn(scanners);
InvokeLogFactory.set(invokeLog);
base = new File("./target/test-classes");
}
use of act.app.TestingAppClassLoader in project actframework by actframework.
the class CommanderByteCodeScannerTest method setup.
@Before
public void setup() throws Exception {
super.setup();
scanner = new CommanderByteCodeScanner();
scannerManager = mock(AppCodeScannerManager.class);
jobManager = mock(JobManager.class);
classLoader = new TestingAppClassLoader(mockApp);
dispatcher = new CliDispatcher(mockApp);
when(mockApp.classLoader()).thenReturn(classLoader);
infoSrc = classLoader.commanderClassMetaInfoManager();
when(mockApp.classLoader()).thenReturn(classLoader);
when(mockApp.cliDispatcher()).thenReturn(dispatcher);
when(mockApp.scannerManager()).thenReturn(scannerManager);
when(mockApp.jobManager()).thenReturn(jobManager);
when(mockAppConfig.possibleControllerClass(anyString())).thenReturn(true);
when(mockRouter.isActionMethod(anyString(), anyString())).thenReturn(false);
C.List<AppByteCodeScanner> scanners = $.cast(C.listOf(scanner));
when(scannerManager.byteCodeScanners()).thenReturn(scanners);
scanner.setApp(mockApp);
base = new File("./target/test-classes");
}
Aggregations