[ 
https://issues.apache.org/jira/browse/DRILL-5730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331518#comment-16331518
 ] 

ASF GitHub Bot commented on DRILL-5730:
---------------------------------------

Github user ilooner commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1045#discussion_r162511432
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/PlanningBase.java 
---
    @@ -84,28 +82,17 @@ protected void testSqlPlan(String sqlCommands) throws 
Exception {
         systemOptions.init();
         @SuppressWarnings("resource")
         final UserSession userSession = 
UserSession.Builder.newBuilder().withOptionManager(systemOptions).build();
    -    final SessionOptionManager sessionOptions = (SessionOptionManager) 
userSession.getOptions();
    +    final SessionOptionManager sessionOptions = userSession.getOptions();
         final QueryOptionManager queryOptions = new 
QueryOptionManager(sessionOptions);
         final ExecutionControls executionControls = new 
ExecutionControls(queryOptions, DrillbitEndpoint.getDefaultInstance());
     
    -    new NonStrictExpectations() {
    -      {
    -        dbContext.getMetrics();
    -        result = new MetricRegistry();
    -        dbContext.getAllocator();
    -        result = allocator;
    -        dbContext.getConfig();
    -        result = config;
    -        dbContext.getOptionManager();
    -        result = systemOptions;
    -        dbContext.getStoreProvider();
    -        result = provider;
    -        dbContext.getClasspathScan();
    -        result = scanResult;
    -        dbContext.getLpPersistence();
    -        result = logicalPlanPersistence;
    -      }
    -    };
    +    when(dbContext.getMetrics()).thenReturn(new MetricRegistry());
    +    when(dbContext.getAllocator()).thenReturn(allocator);
    +    when(dbContext.getConfig()).thenReturn(config);
    +    when(dbContext.getOptionManager()).thenReturn(systemOptions);
    +    when(dbContext.getStoreProvider()).thenReturn(provider);
    +    when(dbContext.getClasspathScan()).thenReturn(scanResult);
    +    when(dbContext.getLpPersistence()).thenReturn(logicalPlanPersistence);
    --- End diff --
    
    I completely agree with this in the long term. Since this code deals with 
the QueryContext I did not dive into creating an interface for the QueryContext 
and a Mock implementation of the interface. I want to limit the scope of this 
PR since it is already quite large, but I have created a follow up ticket to 
handle the mocking of the QueryContext correctly 
https://issues.apache.org/jira/browse/DRILL-6097 . As an additional note, the 
only reason why this code was changed was to take a step towards removing 
JMockit which does not play nice with Eclipse as you have noticed. Removing 
JMockit and replacing it with Mockito was the easiest thing to do at this 
point. Once this change goes in we can revisit the QueryContext in DRILL-6097.


> Fix Unit Test failures on JDK 8 And Some JDK 7 versions
> -------------------------------------------------------
>
>                 Key: DRILL-5730
>                 URL: https://issues.apache.org/jira/browse/DRILL-5730
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Timothy Farkas
>            Assignee: Timothy Farkas
>            Priority: Major
>
> Tests fail on JDK 8 and oracle JDK 7 on my mac
> Failed tests: 
>   TestMetadataProvider.tables:153 expected:<OK> but was:<FAILED>
>   TestMetadataProvider.tablesWithTableNameFilter:212 expected:<OK> but 
> was:<FAILED>
>   TestMetadataProvider.tablesWithSystemTableFilter:187 expected:<OK> but 
> was:<FAILED>
>   TestMetadataProvider.tablesWithTableFilter:176 expected:<OK> but 
> was:<FAILED>
> Tests in error: 
>   TestInfoSchema.selectFromAllTables » UserRemote SYSTEM ERROR: 
> URISyntaxExcepti...
>   TestCustomUserAuthenticator.positiveUserAuth » UserRemote SYSTEM ERROR: 
> URISyn...
>   TestCustomUserAuthenticator.positiveUserAuthAfterNegativeUserAuth » 
> UserRemote
>   TestViewSupport.infoSchemaWithView:350->BaseTestQuery.testRunAndReturn:344 
> » Rpc
>   TestParquetScan.testSuccessFile:58->BaseTestQuery.testRunAndReturn:344 » 
> Rpc o...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to