Search in sources :

Example 11 with Expression

use of io.crate.sql.tree.Expression in project crate by crate.

the class ESClusterUpdateSettingsTaskTest method testUpdateSettingsWithInvalidTimeValue.

@Test
public void testUpdateSettingsWithInvalidTimeValue() throws Exception {
    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage("Invalid value for argument 'cluster.graceful_stop.timeout'");
    Map<String, List<Expression>> settings = new HashMap<String, List<Expression>>() {

        {
            put("cluster.graceful_stop.timeout", ImmutableList.<Expression>of(new ParameterExpression(1)));
        }
    };
    ESClusterUpdateSettingsTask.buildSettingsFrom(settings, new RowN(new Object[] { "-1h" }));
}
Also used : RowN(io.crate.data.RowN) HashMap(java.util.HashMap) ParameterExpression(io.crate.sql.tree.ParameterExpression) Expression(io.crate.sql.tree.Expression) ParameterExpression(io.crate.sql.tree.ParameterExpression) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) Test(org.junit.Test) CrateUnitTest(io.crate.test.integration.CrateUnitTest)

Aggregations

Expression (io.crate.sql.tree.Expression)11 Test (org.junit.Test)6 CrateUnitTest (io.crate.test.integration.CrateUnitTest)5 ImmutableList (com.google.common.collect.ImmutableList)4 ParameterExpression (io.crate.sql.tree.ParameterExpression)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Settings (org.elasticsearch.common.settings.Settings)3 RowN (io.crate.data.RowN)2 SettingsApplier (io.crate.metadata.settings.SettingsApplier)2 ExpressionAnalysisContext (io.crate.analyze.expressions.ExpressionAnalysisContext)1 ExpressionAnalyzer (io.crate.analyze.expressions.ExpressionAnalyzer)1 TableReferenceResolver (io.crate.analyze.expressions.TableReferenceResolver)1 Field (io.crate.analyze.symbol.Field)1 Symbol (io.crate.analyze.symbol.Symbol)1 Bucket (io.crate.data.Bucket)1 SQLTransportIntegrationTest (io.crate.integrationtests.SQLTransportIntegrationTest)1 ESClusterUpdateSettingsPlan (io.crate.planner.node.ddl.ESClusterUpdateSettingsPlan)1 ArrayLiteral (io.crate.sql.tree.ArrayLiteral)1 Literal (io.crate.sql.tree.Literal)1