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

    https://github.com/apache/geode/pull/580#discussion_r129693128
  
    --- Diff: 
geode-core/src/test/java/org/apache/geode/cache/query/internal/OrderByComparatorJUnitTest.java
 ---
    @@ -173,36 +157,54 @@ public void testUnsupportedOrderByForPR() throws 
Exception {
     
       @Test
       public void testSupportedOrderByForRR() throws Exception {
    -
         String unsupportedQueries[] =
    -        {"select distinct p.status from /portfolio1 p order by p.status, 
p.ID",
    -
    -        };
    +        {"select distinct p.status from /portfolio1 p order by p.status, 
p.ID"};
         Object r[][] = new Object[unsupportedQueries.length][2];
    -    QueryService qs;
    -    qs = CacheUtils.getQueryService();
         Position.resetCounter();
    -    // Create Regions
     
    +    // Create Regions
         Region r1 = CacheUtils.createRegion("portfolio1", Portfolio.class);
     
         for (int i = 0; i < 50; i++) {
           r1.put(new Portfolio(i), new Portfolio(i));
         }
     
         for (int i = 0; i < unsupportedQueries.length; i++) {
    -      Query q = null;
    -
    +      Query q;
           CacheUtils.getLogger().info("Executing query: " + 
unsupportedQueries[i]);
           q = CacheUtils.getQueryService().newQuery(unsupportedQueries[i]);
           try {
             r[i][0] = q.execute();
    -
           } catch (QueryInvalidException qe) {
             qe.printStackTrace();
             fail(qe.toString());
           }
         }
       }
     
    +  // The following tests cover edge cases in OrderByComparator.
    +  @Test
    +  public void testCompareTwoNulls() throws Exception {
    +    assert (createComparator().compare(null, null) == 0);
    +  }
    +
    +  @Test
    +  public void testCompareTwoObjectArrays() throws Exception {
    +    String[] arrString1 = {"elephant"};
    +    String[] arrString2 = {"elephants"};
    +    assert (createComparator().compare(arrString2, arrString1) == 1);
    --- End diff --
    
    Same as previous comment. Please use assertThat.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to