예제 #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));
 }