@Test
  public void testFieldsRemainUntouchedOnClear() {
    QueryProperties queryProperties = new QueryProperties();

    // check default values
    Assert.assertNull(queryProperties.getQueryType());

    queryProperties.setQueryType(QueryProperties.QueryType.DDL);

    queryProperties.clear();

    // check that some values are not affected by clear()
    Assert.assertEquals("queryType is not supposed to be cleared", QueryProperties.QueryType.DDL,
        queryProperties.getQueryType());
  }
Some unit tests expect the whole analyze process to run, which is the expected, preferred way.
@param sql the query to analyze
@param fullAnalyze whether to run the full analyze or just some parts of it
@return QueryProperties from the analyzer
ql/src/test/org/apache/hadoop/hive/ql/parse/TestQueryProperties.java