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

    https://github.com/apache/incubator-metron/pull/390#discussion_r91386719
  
    --- Diff: 
metron-platform/metron-common/src/test/java/org/apache/metron/common/stellar/StellarTest.java
 ---
    @@ -56,6 +56,37 @@
     public class StellarTest {
     
       @Test
    +  public void addingLongsShouldYieldLong() throws Exception {
    +    final long timestamp = 1452013350000L;
    +    String query = "TO_EPOCH_TIMESTAMP('2016-01-05 17:02:30', 'yyyy-MM-dd 
HH:mm:ss', 'UTC') + 2";
    +    Assert.assertEquals(timestamp + 2, run(query, new HashMap<>()));
    +  }
    +
    +  @Test
    +  public void addingIntegersShouldYieldAnInteger() throws Exception {
    +    String query = "1 + 2";
    +    Assert.assertEquals(3, run(query, new HashMap<>()));
    +  }
    +
    +  @Test
    +  public void addingDoublesShouldYieldADouble() throws Exception {
    +    String query = "1.0 + 2.0";
    +    Assert.assertEquals(3.0, run(query, new HashMap<>()));
    +  }
    +
    +  @Test
    +  public void 
addingDoubleAndIntegerWhereSubjectIsDoubleShouldYieldADouble() throws Exception 
{
    +    String query = "2.1 + 1";
    +    Assert.assertEquals(3.1, run(query, new HashMap<>()));
    +  }
    +
    +  @Test
    +  public void 
addingDoubleAndIntegerWhereSubjectIsIntegerShouldYieldADouble() throws 
Exception {
    +    String query = "1 + 2.1";
    +    Assert.assertEquals(3.1, run(query, new HashMap<>()));
    +  }
    --- End diff --
    
    Obviously, the same set for multiplication and division.  I'd parameterize 
that case ;)


---
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.
---

Reply via email to