Search in sources :

Example 1 with ConqueryConfig

use of com.bakdata.conquery.models.config.ConqueryConfig in project conquery by bakdata.

the class IntegrationTests method getConfigOverride.

@NotNull
private static ConqueryConfig getConfigOverride(IntegrationTest test, File workDir) {
    ConqueryConfig conf = Cloner.clone(DEFAULT_CONFIG, Map.of(), MAPPER);
    final ConqueryConfig newConf = test.overrideConfig(conf, workDir);
    return newConf;
}
Also used : ConqueryConfig(com.bakdata.conquery.models.config.ConqueryConfig) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ConqueryConfig

use of com.bakdata.conquery.models.config.ConqueryConfig in project conquery by bakdata.

the class DateRangeParserTest method notOnlyClosed.

@Test
public void notOnlyClosed() {
    final DateRangeParser parser = new DateRangeParser(new ConqueryConfig());
    List.of(CDateRange.of(10, 11), CDateRange.exactly(10), CDateRange.atMost(10)).forEach(parser::addLine);
    assertThat(parser.decideType()).isInstanceOf(DateRangeTypeDateRange.class);
}
Also used : ConqueryConfig(com.bakdata.conquery.models.config.ConqueryConfig) Test(org.junit.jupiter.api.Test)

Example 3 with ConqueryConfig

use of com.bakdata.conquery.models.config.ConqueryConfig in project conquery by bakdata.

the class DateRangeParserTest method onlyQuarters.

@Test
public void onlyQuarters() {
    final DateRangeParser parser = new DateRangeParser(new ConqueryConfig());
    List.of(CDateRange.of(QuarterUtils.getFirstDayOfQuarter(2011, 1), QuarterUtils.getLastDayOfQuarter(2011, 1))).forEach(parser::addLine);
    assertThat(parser.decideType()).isInstanceOf(DateRangeTypeQuarter.class);
}
Also used : ConqueryConfig(com.bakdata.conquery.models.config.ConqueryConfig) Test(org.junit.jupiter.api.Test)

Example 4 with ConqueryConfig

use of com.bakdata.conquery.models.config.ConqueryConfig in project conquery by bakdata.

the class RealParserTest method ulpInRange.

@Test
public void ulpInRange() {
    final ConqueryConfig config = new ConqueryConfig();
    config.getPreprocessor().getParsers().setMinPrecision(Math.ulp(10));
    final RealParser realParser = new RealParser(config);
    realParser.registerValue(1d);
    realParser.registerValue(2d);
    realParser.registerValue(-3d);
    // ULP is symmetric on the 0 axis and monotonic, so larger values have a larger ULP
    assertThat(realParser.decideType()).isInstanceOf(FloatArrayStore.class);
    realParser.registerValue(3000d);
    assertThat(realParser.decideType()).isInstanceOf(DoubleArrayStore.class);
}
Also used : ConqueryConfig(com.bakdata.conquery.models.config.ConqueryConfig) Test(org.junit.jupiter.api.Test)

Example 5 with ConqueryConfig

use of com.bakdata.conquery.models.config.ConqueryConfig in project conquery by bakdata.

the class UniqueNameTest method testNameCollision.

@Test
void testNameCollision() {
    final UniqueNamer uniqueNamer = new UniqueNamer(new PrintSettings(true, Locale.ROOT, null, new ConqueryConfig(), null));
    final SimpleResultInfo info1 = new SimpleResultInfo("test", null);
    final SimpleResultInfo info2 = new SimpleResultInfo("test", null);
    final SimpleResultInfo info3 = new SimpleResultInfo("test_1", null);
    final SimpleResultInfo info4 = new SimpleResultInfo("test", null);
    assertThat(uniqueNamer.getUniqueName(info1)).isEqualTo("test");
    assertThat(uniqueNamer.getUniqueName(info2)).isEqualTo("test_1");
    assertThat(uniqueNamer.getUniqueName(info3)).isEqualTo("test_1_1");
    assertThat(uniqueNamer.getUniqueName(info4)).isEqualTo("test_2");
}
Also used : SimpleResultInfo(com.bakdata.conquery.models.query.resultinfo.SimpleResultInfo) ConqueryConfig(com.bakdata.conquery.models.config.ConqueryConfig) UniqueNamer(com.bakdata.conquery.models.query.resultinfo.UniqueNamer) Test(org.junit.jupiter.api.Test)

Aggregations

ConqueryConfig (com.bakdata.conquery.models.config.ConqueryConfig)18 Test (org.junit.jupiter.api.Test)7 Namespace (com.bakdata.conquery.models.worker.Namespace)3 IOException (java.io.IOException)3 PreprocessorCommand (com.bakdata.conquery.commands.PreprocessorCommand)2 MutableInjectableValues (com.bakdata.conquery.io.jackson.MutableInjectableValues)2 IdPrinter (com.bakdata.conquery.models.identifiable.mapping.IdPrinter)2 ManagedQuery (com.bakdata.conquery.models.query.ManagedQuery)2 PrintSettings (com.bakdata.conquery.models.query.PrintSettings)2 ResultInfo (com.bakdata.conquery.models.query.resultinfo.ResultInfo)2 DatasetRegistry (com.bakdata.conquery.models.worker.DatasetRegistry)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 CollectEntitiesCommand (com.bakdata.conquery.commands.CollectEntitiesCommand)1 MigrateCommand (com.bakdata.conquery.commands.MigrateCommand)1 RecodeStoreCommand (com.bakdata.conquery.commands.RecodeStoreCommand)1 ShardNode (com.bakdata.conquery.commands.ShardNode)1 StandaloneCommand (com.bakdata.conquery.commands.StandaloneCommand)1 JsonIntegrationTest (com.bakdata.conquery.integration.json.JsonIntegrationTest)1 ProgrammaticIntegrationTest (com.bakdata.conquery.integration.tests.ProgrammaticIntegrationTest)1