コード例 #1
0
 @Before
 public void setup() throws URISyntaxException {
   hiveDriver = new HiveDriver(delegate, null, true, jdbcUrlParser);
   testUrl = "testUrl";
   when(jdbcUrlParser.parse(testUrl)).thenReturn(jdbcUrl);
   when(jdbcUrl.toString()).thenReturn(testUrl);
 }
コード例 #2
0
 @Test(expected = SQLException.class)
 public void testConnectFailParse() throws SQLException, URISyntaxException {
   String url = "fake-url";
   when(jdbcUrlParser.parse(url)).thenThrow(new URISyntaxException("", ""));
   hiveDriver.connect(url, null);
 }
コード例 #3
0
 @Test
 public void testAcceptsUrlException() throws URISyntaxException, SQLException {
   String url = "fake-url";
   when(jdbcUrlParser.parse(url)).thenThrow(new URISyntaxException("", ""));
   assertFalse(hiveDriver.acceptsURL(url));
 }