OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
com.omnisci.jdbc.OmniSciConnectionTest Class Reference
+ Collaboration diagram for com.omnisci.jdbc.OmniSciConnectionTest:

Public Member Functions

void tst1_binary_unencrypted ()
 
void tst1a_binary_encrypted ()
 
void tst2_http_unencrypted ()
 
void tst3_https_encrypted ()
 
void tst4_https_encrypted_with_server_validation ()
 
void tst5_connect ()
 
void tst6_connect ()
 
void tst7_connect ()
 
void tst8_connect ()
 

Static Package Attributes

static Properties PROPERTIES = new Property_loader("connection_test.properties")
 
static final String user = PROPERTIES.getProperty("default_super_user")
 
static final String password = PROPERTIES.getProperty("default_user_password")
 

Detailed Description

Definition at line 11 of file OmniSciConnectionTest.java.

Member Function Documentation

void com.omnisci.jdbc.OmniSciConnectionTest.tst1_binary_unencrypted ( )
inline

Definition at line 20 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

20  {
21  try {
22  String url = PROPERTIES.getProperty("binary_connection_url") + ":"
23  + PROPERTIES.getProperty("default_db");
24  Connection conn = DriverManager.getConnection(url, user, password);
25  assertNotEquals(null, conn);
26  conn.close();
27  boolean closed = conn.isClosed();
28  assertEquals(true, closed);
29  } catch (SQLException sq) {
30  String err = "Connection test failed " + sq.toString();
31  fail(err);
32  }
33  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst1a_binary_encrypted ( )
inline

Definition at line 36 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

36  {
37  try {
38  String url = PROPERTIES.getProperty("binary_connection_url") + ":"
39  + PROPERTIES.getProperty("default_db") + ":binary_tls";
40  String key_store = PROPERTIES.getProperty("server_key_store");
41  ClassLoader cl = getClass().getClassLoader();
42  key_store = cl.getResource(key_store).getPath();
43  Properties pt = new Properties();
44  pt.setProperty("user", user);
45  pt.setProperty("password", password);
46  pt.setProperty("key_store", key_store);
47  pt.setProperty(
48  "key_store_pwd", PROPERTIES.getProperty("server_key_store_password"));
49  Connection conn = DriverManager.getConnection(url, pt);
50  assertNotEquals(null, conn);
51  conn.close();
52  boolean closed = conn.isClosed();
53  assertEquals(true, closed);
54  } catch (SQLException sq) {
55  String err = "Connection test failed " + sq.toString();
56  fail(err);
57  }
58  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst2_http_unencrypted ( )
inline

Definition at line 61 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

61  {
62  try {
63  String url = PROPERTIES.getProperty("http_connection_url") + ":"
64  + PROPERTIES.getProperty("default_db") + ":http";
65  Connection conn = DriverManager.getConnection(url, user, password);
66  assertNotEquals(null, conn);
67  conn.close();
68  boolean closed = conn.isClosed();
69  assertEquals(true, closed);
70  } catch (SQLException sq) {
71  String err = "Connection test failed " + sq.toString();
72  fail(err);
73  }
74  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst3_https_encrypted ( )
inline

Definition at line 77 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

77  {
78  try {
79  Properties pt = new Properties();
80  pt.setProperty("user", user);
81  pt.setProperty("password", password);
82  pt.setProperty("protocol", "https_insecure");
83  String url = PROPERTIES.getProperty("https_connection_url") + ":"
84  + PROPERTIES.getProperty("default_db");
85  Connection conn = DriverManager.getConnection(url, pt);
86  assertNotEquals(null, conn);
87  conn.close();
88  boolean closed = conn.isClosed();
89  assertEquals(true, closed);
90  } catch (SQLException sq) {
91  String err = "Connection test failed " + sq.toString();
92  fail(err);
93  }
94  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst4_https_encrypted_with_server_validation ( )
inline

Definition at line 97 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

97  {
98  try {
99  String key_store = PROPERTIES.getProperty("server_key_store");
100  ClassLoader cl = getClass().getClassLoader();
101 
102  Properties pt = new Properties();
103  pt.setProperty("user", user);
104  pt.setProperty("password", password);
105  pt.setProperty("protocol", "https");
106  key_store = cl.getResource(key_store).getPath();
107  pt.setProperty("key_store", key_store);
108  pt.setProperty(
109  "key_store_pwd", PROPERTIES.getProperty("server_key_store_password"));
110 
111  String url = PROPERTIES.getProperty("https_connection_url") + ":"
112  + PROPERTIES.getProperty("default_db");
113 
114  Connection conn = DriverManager.getConnection(url, pt);
115  conn.close();
116  assertNotEquals(null, conn);
117  boolean closed = conn.isClosed();
118  assertEquals(true, closed);
119 
120  assertNotEquals(null, conn);
121  } catch (SQLException sq) {
122  String err = "Connection test failed " + sq.toString();
123  fail(err);
124  }
125  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst5_connect ( )
inline

Definition at line 128 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

128  {
129  try {
130  String url = PROPERTIES.getProperty("failed_connection_url") + ":"
131  + PROPERTIES.getProperty("default_db");
132  Properties pt = new Properties();
133  pt.setProperty("user", user);
134  pt.setProperty("password", password);
135  Connection conn = DriverManager.getConnection(url, pt);
136  } catch (SQLException sq) {
137  assertEquals(sq.getMessage(),
138  "No suitable driver found for jdbc:NOT_omnisci:localhost:6274:omnisci");
139  return;
140  }
141  String err = "Connection should have thrown";
142  fail(err);
143  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst6_connect ( )
inline

Definition at line 146 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

146  {
147  try {
148  String url = PROPERTIES.getProperty("binary_connection_url") + ":"
149  + PROPERTIES.getProperty("default_db");
150  Properties pt = new Properties();
151  pt.setProperty("user", user);
152  pt.setProperty("password", password);
153  pt.setProperty("db_name", "omnisci");
154  Connection conn = DriverManager.getConnection(url, pt);
155  } catch (SQLException sq) {
156  fail(sq.getMessage());
157  }
158  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst7_connect ( )
inline

Definition at line 161 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

161  {
162  try {
163  String url = PROPERTIES.getProperty("binary_connection_url") + ":"
164  + PROPERTIES.getProperty("default_db");
165  Properties pt = new Properties();
166  pt.setProperty("user", user);
167  pt.setProperty("password", password);
168  pt.setProperty("db_name", "SomeOtherDB");
169  // Shouldn't fail (url over ride properties.
170  Connection conn = DriverManager.getConnection(url, pt);
171  } catch (SQLException sq) {
172  fail(sq.getMessage());
173  }
174  }
static unsigned fail
Definition: testing.h:30
void com.omnisci.jdbc.OmniSciConnectionTest.tst8_connect ( )
inline

Definition at line 177 of file OmniSciConnectionTest.java.

References Testing.fail, com.omnisci.jdbc.OmniSciConnectionTest.password, com.omnisci.jdbc.OmniSciConnectionTest.PROPERTIES, Experimental.String, and com.omnisci.jdbc.OmniSciConnectionTest.user.

177  {
178  try {
179  String url = PROPERTIES.getProperty("default_mapd_connection_url") + ":"
180  + PROPERTIES.getProperty("default_db");
181  Properties pt = new Properties();
182  pt.setProperty("user", user);
183  pt.setProperty("password", password);
184  pt.setProperty("db_name", "SomeOtherDB");
185  // Shouldn't fail (url over ride properties.
186  Connection conn = DriverManager.getConnection(url, pt);
187  } catch (SQLException sq) {
188  fail(sq.getMessage());
189  }
190  }
static unsigned fail
Definition: testing.h:30

Member Data Documentation


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