Search in sources :

Example 1 with InvokeLog

use of testapp.util.InvokeLog 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");
}
Also used : AppCodeScannerManager(act.app.AppCodeScannerManager) C(org.osgl.util.C) AppByteCodeScanner(act.app.AppByteCodeScanner) TestingAppClassLoader(act.app.TestingAppClassLoader) EventBus(act.event.EventBus) ClassInfoRepository(act.util.ClassInfoRepository) InvokeLog(testapp.util.InvokeLog) Before(org.junit.Before)

Example 2 with InvokeLog

use of testapp.util.InvokeLog 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");
}
Also used : AppCodeScannerManager(act.app.AppCodeScannerManager) C(org.osgl.util.C) AppByteCodeScanner(act.app.AppByteCodeScanner) TestingAppClassLoader(act.app.TestingAppClassLoader) InvokeLog(testapp.util.InvokeLog) MailerByteCodeScanner(act.mail.bytecode.MailerByteCodeScanner) Before(org.junit.Before)

Aggregations

AppByteCodeScanner (act.app.AppByteCodeScanner)2 AppCodeScannerManager (act.app.AppCodeScannerManager)2 TestingAppClassLoader (act.app.TestingAppClassLoader)2 Before (org.junit.Before)2 C (org.osgl.util.C)2 InvokeLog (testapp.util.InvokeLog)2 EventBus (act.event.EventBus)1 MailerByteCodeScanner (act.mail.bytecode.MailerByteCodeScanner)1 ClassInfoRepository (act.util.ClassInfoRepository)1