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

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

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

    https://github.com/apache/drill/pull/788#discussion_r113084244
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/test/rowSet/test/RowSetTest.java 
---
    @@ -0,0 +1,400 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.drill.test.rowSet.test;
    +
    +import static org.junit.Assert.assertEquals;
    +import static org.junit.Assert.assertFalse;
    +import static org.junit.Assert.assertNotNull;
    +import static org.junit.Assert.assertNull;
    +import static org.junit.Assert.assertSame;
    +import static org.junit.Assert.assertTrue;
    +
    +import org.apache.drill.common.types.TypeProtos.DataMode;
    +import org.apache.drill.common.types.TypeProtos.MinorType;
    +import org.apache.drill.exec.record.BatchSchema;
    +import org.apache.drill.exec.vector.accessor.ArrayReader;
    +import org.apache.drill.exec.vector.accessor.ArrayWriter;
    +import org.apache.drill.exec.vector.accessor.TupleAccessor.TupleSchema;
    +import org.apache.drill.test.OperatorFixture;
    +import org.apache.drill.test.rowSet.RowSet.ExtendableRowSet;
    +import org.apache.drill.test.rowSet.RowSet.RowSetReader;
    +import org.apache.drill.test.rowSet.RowSet.RowSetWriter;
    +import org.apache.drill.test.rowSet.RowSet.SingleRowSet;
    +import org.apache.drill.test.rowSet.RowSetComparison;
    +import org.apache.drill.test.rowSet.RowSetSchema;
    +import org.apache.drill.test.rowSet.RowSetSchema.FlattenedSchema;
    +import org.apache.drill.test.rowSet.RowSetSchema.PhysicalSchema;
    +import org.apache.drill.test.rowSet.SchemaBuilder;
    +import org.junit.AfterClass;
    +import org.junit.BeforeClass;
    +import org.junit.Test;
    +
    +import com.google.common.base.Splitter;
    +
    +public class RowSetTest {
    +
    +  private static OperatorFixture fixture;
    +
    +  @BeforeClass
    +  public static void setUpBeforeClass() throws Exception {
    +    fixture = OperatorFixture.standardFixture();
    +  }
    +
    +  @AfterClass
    +  public static void tearDownAfterClass() throws Exception {
    +    fixture.close();
    --- End diff --
    
    Is this the only unit test added to DRILL-5318 / DRILL-5323 which are for 
unit test framework related enhancements? Looks like the new tests in this 
class are to test the new added concept such as "RowSet", "RowSetSchema", 
"FlattenedSchema". Do we have some example that shows how to use those concepts 
to do a operator / sub-operator testing, which I thought are the main purpose 
of the two PRs?  


> Create a sub-operator test framework
> ------------------------------------
>
>                 Key: DRILL-5318
>                 URL: https://issues.apache.org/jira/browse/DRILL-5318
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Tools, Build & Test
>    Affects Versions: 1.11.0
>            Reporter: Paul Rogers
>            Assignee: Paul Rogers
>              Labels: ready-to-commit
>             Fix For: 1.11.0
>
>         Attachments: Sub-OperatorTestFramework.pdf
>
>
> Drill provides two unit test frameworks for whole-server, SQL-based testing: 
> the original {{BaseTestQuery}} and the newer {{ClusterFixture}}. Both use the 
> {{TestBuilder}} mechanism to build system-level functional tests that run 
> queries and check results.
> Jason provided an operator-level test framework based, in part on mocks: 
> As Drill operators become more complex, we have a crying need for true 
> unit-level tests at a level below the whole system and below operators. That 
> is, we need to test the individual pieces that, together, form the operator.
> This umbrella ticket includes a number of tasks needed to create the 
> sub-operator framework. Our intention is that, over time, as we find the need 
> to revisit existing operators, or create new ones, we can employ the 
> sub-operator test framework to exercise code at a finer granularity than is 
> possible prior to this framework.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to