Search in sources :

Example 1 with FloatValue

use of org.neo4j.driver.internal.value.FloatValue in project neo4j by neo4j.

the class TablePlanFormatterTest method withEmptyDetails.

@Test
public void withEmptyDetails() {
    Plan plan = mock(Plan.class);
    Map<String, Value> args = new HashMap<String, Value>(2) {

        {
            put("EstimatedRows", new FloatValue(55));
            put("Details", new StringValue(""));
        }
    };
    when(plan.arguments()).thenReturn(args);
    when(plan.operatorType()).thenReturn("Projection");
    assertThat(tablePlanFormatter.formatPlan(plan), is(String.join(NEWLINE, "+-------------+---------+----------------+", "| Operator    | Details | Estimated Rows |", "+-------------+---------+----------------+", "| +Projection |         |             55 |", "+-------------+---------+----------------+", "")));
}
Also used : HashMap(java.util.HashMap) StringValue(org.neo4j.driver.internal.value.StringValue) Value(org.neo4j.driver.Value) FloatValue(org.neo4j.driver.internal.value.FloatValue) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) FloatValue(org.neo4j.driver.internal.value.FloatValue) Plan(org.neo4j.driver.summary.Plan) StringValue(org.neo4j.driver.internal.value.StringValue) Test(org.junit.Test)

Example 2 with FloatValue

use of org.neo4j.driver.internal.value.FloatValue in project neo4j by neo4j.

the class TablePlanFormatterTest method withNoDetails.

@Test
public void withNoDetails() {
    Plan plan = mock(Plan.class);
    Map<String, Value> args = Collections.singletonMap("EstimatedRows", new FloatValue(55));
    when(plan.arguments()).thenReturn(args);
    when(plan.operatorType()).thenReturn("Projection");
    assertThat(tablePlanFormatter.formatPlan(plan), is(String.join(NEWLINE, "+-------------+----------------+", "| Operator    | Estimated Rows |", "+-------------+----------------+", "| +Projection |             55 |", "+-------------+----------------+", "")));
}
Also used : StringValue(org.neo4j.driver.internal.value.StringValue) Value(org.neo4j.driver.Value) FloatValue(org.neo4j.driver.internal.value.FloatValue) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) FloatValue(org.neo4j.driver.internal.value.FloatValue) Plan(org.neo4j.driver.summary.Plan) Test(org.junit.Test)

Aggregations

CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 Test (org.junit.Test)2 Value (org.neo4j.driver.Value)2 FloatValue (org.neo4j.driver.internal.value.FloatValue)2 StringValue (org.neo4j.driver.internal.value.StringValue)2 Plan (org.neo4j.driver.summary.Plan)2 HashMap (java.util.HashMap)1