OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReassignOwnedTest.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 ReassignOwnedTest extends DDLTest {
12  public ReassignOwnedTest() {
13  resourceDirPath = ReassignOwnedTest.class.getClassLoader().getResource("").getPath();
14  jsonTestDir = "reassignowned";
15  }
16 
17  @Test
18  public void reassignOwned() throws Exception {
19  final JsonObject expectedJsonObject = getJsonFromFile("reassign_owned.json");
20  final TPlanResult result =
21  processDdlCommand("REASSIGN OWNED BY user_1, user_2 To user_3;");
22  final JsonObject actualJsonObject =
23  gson.fromJson(result.plan_result, JsonObject.class);
24  assertEquals(expectedJsonObject, actualJsonObject);
25  }
26 }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:50
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35