Search in sources :

Example 1 with ScreenBasedSettings

use of org.sakuli.actions.settings.ScreenBasedSettings in project sakuli by ConSol.

the class ScreenBasedSettingsSikuliLogSystemOutTest method testDoHandleSikuliLog.

@Test
public void testDoHandleSikuliLog() throws Throwable {
    ScreenBasedSettings testling = BeanLoader.loadBean(ScreenBasedSettings.class);
    testling.setDefaults();
    BeanLoader.loadBean(LoggerInitializer.class).initLoggerContext();
    System.out.println("LOG-FOLDER: " + logFile);
    //errors
    Debug.error("SIKULI-ERROR-message");
    assertLastLine(logFile, "SIKULI-", LogLevel.INFO, "[error] SIKULI-ERROR-message");
    //enter message like for typing
    Debug.enter("SIKULI-ENTER-message");
    assertLastLine(logFile, "SIKULI-", LogLevel.INFO, "[profile] entering: SIKULI-ENTER-message");
    //info messages
    Debug.info("SIKULI-INFO-message");
    assertLastLine(logFile, "SIKULI-", LogLevel.INFO, "[info] SIKULI-INFO-message");
    //debug messages
    Debug.log(-3, "SIKULI-DEBUG-message");
    assertLastLine(logFile, "SIKULI-", LogLevel.INFO, "[debug] SIKULI-DEBUG-message");
}
Also used : ScreenBasedSettings(org.sakuli.actions.settings.ScreenBasedSettings) LoggerInitializer(org.sakuli.utils.LoggerInitializer) Test(org.testng.annotations.Test) AopBaseTest(org.sakuli.aop.AopBaseTest)

Example 2 with ScreenBasedSettings

use of org.sakuli.actions.settings.ScreenBasedSettings in project sakuli by ConSol.

the class ScreenBasedSettingsTest method testSetDefaults.

@Test(expectedExceptions = InvalidParameterException.class, expectedExceptionsMessageRegExp = "the property '" + ActionProperties.DEFAULT_HIGHLIGHT_SEC + "' has to be greater as 1, but was 0.6")
public void testSetDefaults() throws Exception {
    ActionProperties props = new ActionProperties();
    props.setDefaultHighlightSeconds(0.6f);
    SakuliProperties sakuliProps = new SakuliProperties();
    sakuliProps.setTessDataLibFolder(Paths.get("."));
    ScreenBasedSettings testling = new ScreenBasedSettings(props, sakuliProps);
    testling.setDefaults();
}
Also used : ActionProperties(org.sakuli.datamodel.properties.ActionProperties) ScreenBasedSettings(org.sakuli.actions.settings.ScreenBasedSettings) SakuliProperties(org.sakuli.datamodel.properties.SakuliProperties) Test(org.testng.annotations.Test)

Aggregations

ScreenBasedSettings (org.sakuli.actions.settings.ScreenBasedSettings)2 Test (org.testng.annotations.Test)2 AopBaseTest (org.sakuli.aop.AopBaseTest)1 ActionProperties (org.sakuli.datamodel.properties.ActionProperties)1 SakuliProperties (org.sakuli.datamodel.properties.SakuliProperties)1 LoggerInitializer (org.sakuli.utils.LoggerInitializer)1