Search in sources :

Example 1 with AbsoluteErrorThreshold

use of com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold in project dsbulk by datastax.

the class LogSettingsTest method should_accept_maxQueryWarnings_as_absolute_number.

@Test()
void should_accept_maxQueryWarnings_as_absolute_number() throws IOException {
    Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxQueryWarnings", 20);
    LogSettings settings = new LogSettings(config, executionId);
    settings.init();
    ErrorThreshold threshold = settings.queryWarningsThreshold;
    assertThat(threshold).isInstanceOf(AbsoluteErrorThreshold.class);
    assertThat(((AbsoluteErrorThreshold) threshold).getMaxErrors()).isEqualTo(20);
}
Also used : AbsoluteErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold) Config(com.typesafe.config.Config) RatioErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.RatioErrorThreshold) ErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold) AbsoluteErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold) UnlimitedErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.UnlimitedErrorThreshold) Test(org.junit.jupiter.api.Test)

Example 2 with AbsoluteErrorThreshold

use of com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold in project dsbulk by datastax.

the class LogSettingsTest method should_accept_maxErrors_as_absolute_number.

@Test()
void should_accept_maxErrors_as_absolute_number() throws IOException {
    Config config = TestConfigUtils.createTestConfig("dsbulk.log", "maxErrors", 20);
    LogSettings settings = new LogSettings(config, executionId);
    settings.init();
    ErrorThreshold threshold = settings.errorThreshold;
    assertThat(threshold).isInstanceOf(AbsoluteErrorThreshold.class);
    assertThat(((AbsoluteErrorThreshold) threshold).getMaxErrors()).isEqualTo(20);
}
Also used : AbsoluteErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold) Config(com.typesafe.config.Config) RatioErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.RatioErrorThreshold) ErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold) AbsoluteErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold) UnlimitedErrorThreshold(com.datastax.oss.dsbulk.workflow.api.error.UnlimitedErrorThreshold) Test(org.junit.jupiter.api.Test)

Aggregations

AbsoluteErrorThreshold (com.datastax.oss.dsbulk.workflow.api.error.AbsoluteErrorThreshold)2 ErrorThreshold (com.datastax.oss.dsbulk.workflow.api.error.ErrorThreshold)2 RatioErrorThreshold (com.datastax.oss.dsbulk.workflow.api.error.RatioErrorThreshold)2 UnlimitedErrorThreshold (com.datastax.oss.dsbulk.workflow.api.error.UnlimitedErrorThreshold)2 Config (com.typesafe.config.Config)2 Test (org.junit.jupiter.api.Test)2