OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InsertValuesTest.java
Go to the documentation of this file.
1 package com.mapd.parser.extension.ddl;
2 
3 import static org.junit.Assert.assertEquals;
4 
5 import com.google.gson.JsonObject;
6 
7 import org.junit.Test;
8 
9 import ai.heavy.thrift.calciteserver.TPlanResult;
10 
11 public class InsertValuesTest extends DDLTest {
12  public InsertValuesTest() {
13  resourceDirPath = InsertValuesTest.class.getClassLoader().getResource("").getPath();
14  jsonTestDir = "insert";
15  }
16 
17  @Test
18  public void insertValues() throws Exception {
19  final JsonObject expectedJsonObject = getJsonFromFile("insert_values.json");
20  final TPlanResult result =
21  processDdlCommand("insert into t(a, b, d, n, ar) values (123786239487123, "
22  + "false, 102938.503924850192312354312345312, 43.12,"
23  + " {'foo', NULL, 'bar'});");
24  final JsonObject actualJsonObject =
25  gson.fromJson(result.plan_result, JsonObject.class);
26  assertEquals(expectedJsonObject, actualJsonObject);
27  }
28 }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35