Github user kavinderd commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/895#discussion_r78207962
--- Diff:
pxf/pxf-hive/src/test/java/org/apache/hawq/pxf/plugins/hive/HiveDataFragmenterTest.java
---
@@ -52,55 +52,55 @@
HiveMetaStoreClient hiveClient;
HiveDataFragmenter fragmenter;
- @Test
- public void construction() throws Exception {
- prepareConstruction();
- fragmenter = new HiveDataFragmenter(inputData);
-
PowerMockito.verifyNew(JobConf.class).withArguments(hadoopConfiguration,
HiveDataFragmenter.class);
-
PowerMockito.verifyNew(HiveMetaStoreClient.class).withArguments(hiveConfiguration);
- }
-
- @Test
- public void constructorCantAccessMetaStore() throws Exception {
- prepareConstruction();
-
PowerMockito.whenNew(HiveMetaStoreClient.class).withArguments(hiveConfiguration).thenThrow(new
MetaException("which way to albuquerque"));
-
- try {
- fragmenter = new HiveDataFragmenter(inputData);
- fail("Expected a RuntimeException");
- } catch (RuntimeException ex) {
- assertEquals(ex.getMessage(), "Failed connecting to Hive
MetaStore service: which way to albuquerque");
- }
- }
-
- @Test
- public void invalidTableName() throws Exception {
- prepareConstruction();
- fragmenter = new HiveDataFragmenter(inputData);
-
-
when(inputData.getDataSource()).thenReturn("t.r.o.u.b.l.e.m.a.k.e.r");
-
- try {
- fragmenter.getFragments();
- fail("Expected an IllegalArgumentException");
- } catch (IllegalArgumentException ex) {
- assertEquals(ex.getMessage(), "\"t.r.o.u.b.l.e.m.a.k.e.r\" is
not a valid Hive table name. Should be either <table_name> or
<db_name.table_name>");
- }
- }
-
- private void prepareConstruction() throws Exception {
- inputData = mock(InputData.class);
-
- hadoopConfiguration = mock(Configuration.class);
-
PowerMockito.whenNew(Configuration.class).withNoArguments().thenReturn(hadoopConfiguration);
-
- jobConf = mock(JobConf.class);
-
PowerMockito.whenNew(JobConf.class).withArguments(hadoopConfiguration,
HiveDataFragmenter.class).thenReturn(jobConf);
-
- hiveConfiguration = mock(HiveConf.class);
-
PowerMockito.whenNew(HiveConf.class).withNoArguments().thenReturn(hiveConfiguration);
-
- hiveClient = mock(HiveMetaStoreClient.class);
-
PowerMockito.whenNew(HiveMetaStoreClient.class).withArguments(hiveConfiguration).thenReturn(hiveClient);
- }
+// @Test
--- End diff --
Can you just delete all this commented code?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---