OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest Class Reference
+ Collaboration diagram for ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest:

Classes

class  QueryStruct
 

Public Member Functions

void setUp () throws Exception
 
void tearDown () throws Exception
 
void tst01_get_meta_data () throws Exception
 
void tst02_heavyDB_table () throws Exception
 
void tst03_heavyDB_table () throws Exception
 
void tst04_heavyDB_table () throws Exception
 
void tst05_user_table () throws Exception
 
void tst06_user_table () throws Exception
 
void tst07_user_table () throws Exception
 
void tst08_user_table () throws Exception
 
void tst09_user_table () throws Exception
 
void tst10_heavyDB_table () throws Exception
 
void tst11_user2_table () throws Exception
 
void getTablePrivileges (Connection conn, QueryStruct qt, ArrayList< HashMap< String, String >> rows) throws Exception
 
void getDriverVersion () throws SQLException
 
void getTables () throws Exception
 

Static Package Attributes

static Properties PROPERTIES = new Property_loader("metadata_test.properties")
 
static final ArrayList< String > default_tables
 
static final ArrayList< String > default_perms
 
static final String super_user = PROPERTIES.getProperty("default_super_user")
 
static final String super_password = PROPERTIES.getProperty("default_user_password")
 
static final String user1 = PROPERTIES.getProperty("user1")
 
static final String user1_password = PROPERTIES.getProperty("user1_password")
 
static final String user_url = PROPERTIES.getProperty("user_db_connection_url")
 
static final String user_table1 = PROPERTIES.getProperty("tst_table1")
 
static final String user_table2 = PROPERTIES.getProperty("tst_table2")
 

Private Member Functions

void run_command (Statement st, String cmd) throws SQLException
 
void set_user2 () throws Exception
 
void set_user1 (boolean extra_table) throws Exception
 
void set_heavyDB () throws Exception
 
void drop_setup () throws Exception
 
void test_permissons (Connection conn, QueryStruct qt, ArrayList< String > possible_tables) throws Exception
 
ArrayList< String > getTablesFromResultSet (ResultSet rs) throws SQLException
 

Private Attributes

Connection m_super_conn = null
 

Detailed Description

Definition at line 15 of file HeavyAIDatabaseMetaDataTest.java.

Member Function Documentation

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup ( ) throws Exception
inlineprivate

Definition at line 165 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command().

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTables(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst02_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst03_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst04_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst05_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst06_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst07_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst08_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst09_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst10_heavyDB_table(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst11_user2_table().

165  {
166  Statement st = m_super_conn.createStatement();
167  try {
168  // Drop the lot even of they aren't there to make the code easier
169  run_command(st, PROPERTIES.getProperty("drop_tst_table1"));
170  run_command(st, PROPERTIES.getProperty("drop_tst_table2"));
171  run_command(st, PROPERTIES.getProperty("drop_user1"));
172  run_command(st, PROPERTIES.getProperty("drop_user2"));
173  run_command(st, PROPERTIES.getProperty("drop_user_db"));
174  } catch (SQLException sE) {
175  System.out.println("drop_setup ERROR");
176  System.out.println(sE.toString());
177  throw(sE);
178  } finally {
179  st.close();
180  }
181  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getDriverVersion ( ) throws SQLException
inline

Definition at line 488 of file HeavyAIDatabaseMetaDataTest.java.

488  {
489  int max = m_super_conn.getMetaData().getDatabaseMajorVersion();
490  assertNotEquals(0, max);
491  int min = m_super_conn.getMetaData().getDatabaseMinorVersion();
492  assertNotEquals(0, max);
493  }
void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTablePrivileges ( Connection  conn,
QueryStruct  qt,
ArrayList< HashMap< String, String >>  rows 
) throws Exception
inline

Definition at line 443 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.QueryStruct.D, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.QueryStruct.S, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.QueryStruct.T.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons().

445  {
446  {
447  ResultSet privileges = conn.getMetaData().getTablePrivileges(qt.D, qt.S, qt.T);
448  assertEquals(7, privileges.getMetaData().getColumnCount());
449 
450  while (privileges.next()) {
451  HashMap<String, String> record = new HashMap<String, String>();
452  record.put("TABLE_CAT", privileges.getString("TABLE_CAT"));
453  record.put("TABLE_SCHEM", privileges.getString("TABLE_SCHEM"));
454  record.put("TABLE_NAME", privileges.getString("TABLE_NAME"));
455  record.put("PRIVILEGE", privileges.getString("PRIVILEGE"));
456  record.put("GRANTOR", privileges.getString("GRANTOR"));
457  record.put("GRANTEE", privileges.getString("GRANTEE"));
458  record.put("IS_GRANTABLE", privileges.getString("IS_GRANTABLE"));
459  rows.add(record);
460  }
461  }
462  }
void getTablePrivileges(Connection conn, QueryStruct qt, ArrayList< HashMap< String, String >> rows)

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTables ( ) throws Exception
inline

Definition at line 532 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTablesFromResultSet(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_heavyDB().

532  {
533  ArrayList<String> heavyDB_2_tables = new ArrayList<String>() {
534  {
535  add("test_base_table1");
536  add("test_base_table2");
537  add("test_base_table3");
538  }
539  };
540  ArrayList<String> system_tables = new ArrayList<String>() {
541  {
542  add("dashboards");
543  add("databases");
544  add("memory_details");
545  add("memory_summary");
546  add("permissions");
547  add("role_assignments");
548  add("roles");
549  add("storage_details");
550  add("tables");
551  add("users");
552  }
553  };
554 
555  set_heavyDB();
556  ResultSet heavyDB_2_tables_result_set =
557  m_super_conn.getMetaData().getTables("heavyDB_2", null, null, null);
558  ArrayList<String> actual_heavyDB_2_tables =
559  getTablesFromResultSet(heavyDB_2_tables_result_set);
560  assertEquals(heavyDB_2_tables, actual_heavyDB_2_tables);
561 
562  ResultSet system_tables_result_set =
563  m_super_conn.getMetaData().getTables("information_schema", null, null, null);
564  ArrayList<String> actual_system_tables =
565  getTablesFromResultSet(system_tables_result_set);
566  assertTrue(actual_system_tables.containsAll(system_tables));
567  drop_setup();
568  }
ArrayList< String > getTablesFromResultSet(ResultSet rs)

+ Here is the call graph for this function:

ArrayList<String> ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTablesFromResultSet ( ResultSet  rs) throws SQLException
inlineprivate

Definition at line 517 of file HeavyAIDatabaseMetaDataTest.java.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTables().

517  {
518  ArrayList<String> sorted_tables = new ArrayList<String>();
519  int column_count = rs.getMetaData().getColumnCount();
520  while (rs.next()) {
521  for (int i = 1; i <= column_count; i++) {
522  if (rs.getMetaData().getColumnName(i) == "TABLE_NAME") {
523  sorted_tables.add(rs.getString(i));
524  }
525  }
526  }
527  Collections.sort(sorted_tables);
528  return sorted_tables;
529  }

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command ( Statement  st,
String  cmd 
) throws SQLException
inlineprivate

Definition at line 84 of file HeavyAIDatabaseMetaDataTest.java.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_heavyDB(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user2(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.setUp(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tearDown().

84  {
85  try {
86  st.executeUpdate(cmd);
87  } catch (SQLException sE) {
88  // Intention is to ignore simple object does not exist
89  // errors on drop commands
90  if (0 != sE.getErrorCode()) {
91  System.out.println("run_command ERROR");
92  System.out.println(sE.toString());
93  throw(sE);
94  }
95  }
96  }

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_heavyDB ( ) throws Exception
inlineprivate

Definition at line 145 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command().

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTables(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst02_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst03_heavyDB_table(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst04_heavyDB_table().

145  {
146  Statement st = m_super_conn.createStatement();
147  try {
148  run_command(st, PROPERTIES.getProperty("drop_base_table1"));
149  run_command(st, PROPERTIES.getProperty("create_base_table1"));
150  run_command(st, PROPERTIES.getProperty("drop_base_table2"));
151  run_command(st, PROPERTIES.getProperty("create_base_table2"));
152  run_command(st, PROPERTIES.getProperty("drop_base_table3"));
153  run_command(st, PROPERTIES.getProperty("create_base_table3"));
154  } catch (SQLException sE) {
155  System.out.println("set_user1 ERROR");
156  System.out.println(sE.toString());
157  throw(sE);
158  } finally {
159  st.close();
160  }
161  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1 ( boolean  extra_table) throws Exception
inlineprivate

Definition at line 116 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1_password, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst05_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst06_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst07_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst08_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst09_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst10_heavyDB_table(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst11_user2_table().

116  {
117  Statement st = m_super_conn.createStatement();
118  Connection conn = null;
119  try {
120  run_command(st, PROPERTIES.getProperty("drop_user1"));
121  run_command(st, PROPERTIES.getProperty("drop_user_db"));
122 
123  run_command(st, PROPERTIES.getProperty("create_user1"));
124  run_command(st, PROPERTIES.getProperty("create_user_db"));
125  st.close();
126 
127  conn = DriverManager.getConnection(user_url, user1, user1_password);
128  st = conn.createStatement();
129  run_command(st, PROPERTIES.getProperty("drop_tst_table1"));
130  run_command(st, PROPERTIES.getProperty("create_tst_table1"));
131  if (extra_table == true) {
132  run_command(st, PROPERTIES.getProperty("drop_tst_table2"));
133  run_command(st, PROPERTIES.getProperty("create_tst_table2"));
134  }
135  } catch (SQLException sE) {
136  System.out.println("set_user1 ERROR");
137  System.out.println(sE.toString());
138  throw(sE);
139  } finally {
140  st.close();
141  if (conn != null) conn.close();
142  }
143  }
tuple conn
Definition: report.py:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user2 ( ) throws Exception
inlineprivate

Definition at line 98 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_user, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst11_user2_table().

98  {
99  Connection x_conn = DriverManager.getConnection(user_url, super_user, super_password);
100  Statement st = x_conn.createStatement();
101  try {
102  run_command(st, PROPERTIES.getProperty("drop_user2"));
103  run_command(st, PROPERTIES.getProperty("create_user2"));
104  run_command(st, PROPERTIES.getProperty("grant_user2_db_access"));
105  run_command(st, PROPERTIES.getProperty("grant_user2_tble_select"));
106  } catch (SQLException sE) {
107  System.out.println("set_user2 ERROR");
108  System.out.println(sE.toString());
109  throw(sE);
110  } finally {
111  st.close();
112  x_conn.close();
113  }
114  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.setUp ( ) throws Exception
inline

Definition at line 51 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.m_super_conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_password, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_user.

51  {
52  // 1. Connect to the default db to create the actual db used for the tests
53  Connection l_conn = DriverManager.getConnection(
54  PROPERTIES.getProperty("default_db_connection_url"),
55  super_user,
57  Statement st = l_conn.createStatement();
58  // 2. Create base db and connect. Shouldn't need to reconnect to
59  // the default db again.
60  run_command(st, PROPERTIES.getProperty("drop_base_db"));
61  run_command(st, PROPERTIES.getProperty("create_base_db"));
62  st.close();
63  l_conn.close();
64 
65  m_super_conn = DriverManager.getConnection(
66  PROPERTIES.getProperty("base_db_connection_url"), super_user, super_password);
67  }

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tearDown ( ) throws Exception
inline

Definition at line 70 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.run_command(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_password, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_user.

70  {
71  m_super_conn.close();
72  // When we drop a DB all its connections are invalidated, so we do it from
73  // a connection to another DB
74  Connection default_conn = DriverManager.getConnection(
75  PROPERTIES.getProperty("default_db_connection_url"),
76  super_user,
78  Statement st = default_conn.createStatement();
79  run_command(st, PROPERTIES.getProperty("drop_base_db"));
80  st.close();
81  default_conn.close();
82  }

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons ( Connection  conn,
QueryStruct  qt,
ArrayList< String >  possible_tables 
) throws Exception
inlineprivate

Definition at line 409 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_perms, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.getTablePrivileges(), Integer, and report.rows.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst02_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst03_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst04_heavyDB_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst05_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst06_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst07_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst08_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst09_user_table(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst10_heavyDB_table(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst11_user2_table().

411  {
412  ArrayList<HashMap<String, String>> rows = new ArrayList<HashMap<String, String>>();
413 
414  getTablePrivileges(conn, qt, rows);
415  assertEquals(qt.result_count, rows.size());
416 
417  HashMap<String, Integer> record_count_accumulator = new HashMap<String, Integer>();
418  for (HashMap<String, String> record : rows) {
419  String table_name = record.get("TABLE_NAME");
420 
421  assertTrue(possible_tables.contains(table_name));
422  String privilege = record.get("PRIVILEGE");
423  String grantee = record.get("GRANTEE");
424  assertTrue(default_perms.contains(privilege));
425  // Count all records for a table_name + privilege + grantee.
426  // Should only be one each
427  String key = table_name + privilege + grantee;
428  // insert zero if new record and alway increment
429  record_count_accumulator.put(
430  key, record_count_accumulator.getOrDefault(key, 0) + 1);
431  }
432  // Since there are the correct number of perms returned
433  // and each perm is only listed once this should mean all the type
434  // of perms are present
435  for (Integer count : record_count_accumulator.values()) {
436  // Check each instance only orrurs once.
437  assertEquals(1, count.intValue());
438  }
439 
440  rows.clear();
441  }
tuple rows
Definition: report.py:114
void getTablePrivileges(Connection conn, QueryStruct qt, ArrayList< HashMap< String, String >> rows)
tuple conn
Definition: report.py:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst01_get_meta_data ( ) throws Exception
inline

Definition at line 184 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_user.

184  {
185  DatabaseMetaData dM = m_super_conn.getMetaData();
186  assertEquals(super_user, dM.getUserName());
187  assertNotEquals(null, dM.getDatabaseProductVersion());
188  }
void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst02_heavyDB_table ( ) throws Exception
inline

Definition at line 198 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.m_super_conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_heavyDB(), heavydb.dtypes.T, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons().

198  {
199  // Get all of the tables in the base_db as super user
200  set_heavyDB();
201  QueryStruct qS = new QueryStruct() {
202  {
203  D = "%";
204  S = "%";
205  T = "%";
206  result_count = 24;
207  }
208  };
210  drop_setup();
211  }
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst03_heavyDB_table ( ) throws Exception
inline

Definition at line 214 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.m_super_conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_heavyDB(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1.

214  {
215  // Get one specfic table in the base_db as super user
216  set_heavyDB();
217  QueryStruct qS = new QueryStruct() {
218  {
219  D = "%";
220  S = "%";
221  T = PROPERTIES.getProperty("base_t3");
222  result_count = 8;
223  }
224  };
225  ArrayList<String> possible_tables = default_tables;
226  possible_tables.add(user_table1);
227  test_permissons(m_super_conn, qS, possible_tables);
228  drop_setup();
229  }
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst04_heavyDB_table ( ) throws Exception
inline

Definition at line 232 of file HeavyAIDatabaseMetaDataTest.java.

References ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.m_super_conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_heavyDB(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1.

232  {
233  // Get a specfic table in the base_db as super user with a wild card search
234  set_heavyDB();
235  QueryStruct qS = new QueryStruct() {
236  {
237  D = PROPERTIES.getProperty("default_db");
238  S = "%";
239  T = PROPERTIES.getProperty("base_table_ptrn");
240  result_count = 8;
241  }
242  };
243  ArrayList<String> possible_tables = default_tables;
244  possible_tables.add(user_table1);
245  test_permissons(m_super_conn, qS, possible_tables);
246  drop_setup();
247  }
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst05_user_table ( ) throws Exception
inline

Definition at line 250 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

250  {
251  // Get the only table in the user_db as user1 using a wild card
252  boolean extra_table = false;
253  set_user1(extra_table); // create database and a single test table
254  QueryStruct qS = new QueryStruct() {
255  {
256  D = "%";
257  S = "%";
258  T = "%";
259  result_count = 8;
260  }
261  };
262  Connection conn = DriverManager.getConnection(user_url, user1, user1_password);
263  ArrayList<String> possible_tables = default_tables;
264  possible_tables.add(user_table1);
265  test_permissons(conn, qS, possible_tables);
266  conn.close(); // close connection
267  drop_setup(); // drop user1 and tables
268  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst06_user_table ( ) throws Exception
inline

Definition at line 271 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

271  {
272  // Get the only table by name in the user_db as user1
273  boolean extra_table = false;
274  set_user1(extra_table); // create database and a single test table
275  QueryStruct qS = new QueryStruct() {
276  {
277  D = "%";
278  S = "%";
279  T = user_table1;
280  result_count = 8;
281  }
282  };
283  Connection conn = DriverManager.getConnection(user_url, user1, user1_password);
284  ArrayList<String> possible_tables = default_tables;
285  possible_tables.add(user_table1);
286  test_permissons(conn, qS, possible_tables);
287  conn.close(); // close connection
288  drop_setup(); // drop user1 and tables
289  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst07_user_table ( ) throws Exception
inline

Definition at line 292 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

292  {
293  // Get the only table in the user_db as user1 using null for table name
294  boolean extra_table = false;
295  set_user1(extra_table); // create database and a single test table
296  QueryStruct qS = new QueryStruct() {
297  {
298  D = "%";
299  S = "%";
300  T = null;
301  result_count = 8;
302  }
303  };
304  Connection conn = DriverManager.getConnection(user_url, user1, user1_password);
305  ArrayList<String> possible_tables = default_tables;
306  possible_tables.add(user_table1);
307  test_permissons(conn, qS, possible_tables);
308  conn.close(); // close connection
309  drop_setup(); // drop user1 and tables
310  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst08_user_table ( ) throws Exception
inline

Definition at line 313 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_tables, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table2, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

313  {
314  // Get the two table in the user_db as user1 using a wild card
315  boolean extra_table = true;
316  set_user1(extra_table); // create database and a single test table
317  QueryStruct qS = new QueryStruct() {
318  {
319  D = "%";
320  S = "%";
321  T = PROPERTIES.getProperty("table_ptrn");
322  result_count = 16;
323  }
324  };
325  Connection conn = DriverManager.getConnection(user_url, user1, user1_password);
326  ArrayList<String> possible_tables = default_tables;
327  possible_tables.add(user_table1);
328  possible_tables.add(user_table2); // add extra table to reference
329  test_permissons(conn, qS, possible_tables);
330  conn.close(); // close connection
331  drop_setup(); // drop user1 and tables
332  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst09_user_table ( ) throws Exception
inline

Definition at line 335 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user1_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table2, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

335  {
336  // Get the two table in the user_db as user1 using a wild card
337  boolean extra_table = true;
338  set_user1(extra_table); // create database and a single test table
339  QueryStruct qS = new QueryStruct() {
340  {
341  D = PROPERTIES.getProperty("user_db");
342  S = "%";
343  T = PROPERTIES.getProperty("table_ptrn");
344  result_count = 16;
345  }
346  };
347  ArrayList<String> possible_tables = new ArrayList<String>() {
348  { add(user_table1); }
349  { add(user_table2); }
350  };
351  Connection conn = DriverManager.getConnection(user_url, user1, user1_password);
352  test_permissons(conn, qS, possible_tables);
353  conn.close(); // close connection
354  drop_setup(); // drop user1 and tables
355  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst10_heavyDB_table ( ) throws Exception
inline

Definition at line 358 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_password, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_user, heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table2, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

358  {
359  // Get the two table in the user_db as super user using a wild card
360  boolean extra_table = true;
361  set_user1(extra_table); // create database and a single test table
362  QueryStruct qS = new QueryStruct() {
363  {
364  D = PROPERTIES.getProperty("user_db");
365  S = "%";
366  T = PROPERTIES.getProperty("table_ptrn");
367  result_count = 32; // rows returned are 2 tables * 8 permissions * 2 users; super
368  // user and user1
369  }
370  };
371  ArrayList<String> possible_tables = new ArrayList<String>() {
372  { add(user_table1); }
373  { add(user_table2); }
374  };
375  Connection conn = DriverManager.getConnection(user_url, super_user, super_password);
376  test_permissons(conn, qS, possible_tables);
377  conn.close(); // close connection
378  drop_setup(); // drop user1 and tables
379  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.tst11_user2_table ( ) throws Exception
inline

Definition at line 382 of file HeavyAIDatabaseMetaDataTest.java.

References report.conn, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.drop_setup(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.PROPERTIES, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user1(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.set_user2(), heavydb.dtypes.T, ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons(), ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table1, and ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_url.

382  {
383  // Get a single table in the user_db as user2 user using a wild card
384  // user2 only has select access on a single table
385  boolean extra_table = true;
386  set_user1(extra_table); // create database and a single test table
387  set_user2(); // create database and a single test table
388  QueryStruct qS = new QueryStruct() {
389  {
390  D = PROPERTIES.getProperty("user_db");
391  S = "%";
392  T = PROPERTIES.getProperty("table_ptrn");
393  result_count = 1; // rows returned are 1 tables * 1 permissions * 1 users; user2
394  }
395  };
396  ArrayList<String> possible_tables = new ArrayList<String>() {
397  { add(user_table1); }
398  };
399 
400  Connection conn = DriverManager.getConnection(user_url,
401  PROPERTIES.getProperty("user2"),
402  PROPERTIES.getProperty("user2_password"));
403 
404  test_permissons(conn, qS, possible_tables);
405  conn.close(); // close connection
406  drop_setup(); // drop user1 and tables
407  }
tuple conn
Definition: report.py:41
void test_permissons(Connection conn, QueryStruct qt, ArrayList< String > possible_tables)

+ Here is the call graph for this function:

Member Data Documentation

final ArrayList<String> ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.default_perms
staticpackage
Initial value:
= new ArrayList<String>() {
{
add("CREATE");
add("DROP");
add("SELECT");
add("INSERT");
add("UPDATE");
add("DELETE");
add("TRUNCATE");
add("ALTER");
}
}

Definition at line 26 of file HeavyAIDatabaseMetaDataTest.java.

Referenced by ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.test_permissons().

final String ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.super_password = PROPERTIES.getProperty("default_user_password")
staticpackage
final String ai.heavy.jdbc.HeavyAIDatabaseMetaDataTest.user_table2 = PROPERTIES.getProperty("tst_table2")
staticpackage

The documentation for this class was generated from the following file: