apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (APEXMALHAR-2010) Add transform operator
Date Mon, 21 Mar 2016 07:09:25 GMT

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

ASF GitHub Bot commented on APEXMALHAR-2010:
--------------------------------------------

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

    https://github.com/apache/incubator-apex-malhar/pull/209#discussion_r56787093
  
    --- Diff: library/src/test/java/com/datatorrent/lib/util/PojoUtilsTest.java ---
    @@ -489,4 +483,59 @@ public void testWrongSetterArgument()
         final Class<?> testPojoClass = TestPojo.class;
         createSetter(testPojoClass, TestPojo.INT_FIELD_NAME, int.class);
       }
    +
    +  @Test (expected = RuntimeException.class)
    +  public void testPrivateFieldExpression()
    +  {
    +    final Class<?> testPojoClass = TestPojo.class;
    +    createExpression(testPojoClass, "privateIntField", int.class);
    +  }
    +
    +  @Test
    +  public void testBasicExpression()
    +  {
    +    TestPojo testObj = new TestPojo(1);
    +    Class<?> testObjClass = testObj.getClass();
    +
    +    assertEquals(testObj.getIntVal(), createExpression(testObjClass, "intField", int.class).execute(testObj));
    +    assertEquals(testObj.getIntVal(), createExpression(testObjClass, "intVal", int.class).execute(testObj));
    +  }
    +
    +  @Test (expected = RuntimeException.class)
    +  public void testPrivateField()
    +  {
    +    final Class<?> testPojoClass = TestPojo.class;
    +    @SuppressWarnings("unused")
    +    SetterInt<Object> setterInt = createSetterInt(testPojoClass, "privateIntField");
    +  }
    +
    +  @Test
    +  public void testNestedPOJOExpression()
    +  {
    +    Expression expression = createExpression(fqcn, "innerObj.boolVal", boolean.class);
    +    assertTrue((Boolean)expression.execute(testObj));
    +
    +    expression = createExpression(fqcn, "{$.innerObj.boolVal}", boolean.class);
    +    assertTrue((Boolean)expression.execute(testObj));
    +
    +    expression = createExpression(fqcn, "$.innerObj.boolVal", boolean.class);
    +    assertTrue((Boolean)expression.execute(testObj));
    +
    +    expression = createExpression(fqcn, "!{$.innerObj.boolVal}", boolean.class);
    +    assertFalse((Boolean)expression.execute(testObj));
    +
    +    expression = createExpression(fqcn, "!{$}.innerObj.boolVal", boolean.class);
    --- End diff --
    
    Done.


> Add transform operator
> ----------------------
>
>                 Key: APEXMALHAR-2010
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2010
>             Project: Apache Apex Malhar
>          Issue Type: New Feature
>          Components: algorithms
>    Affects Versions: 3.4.0
>            Reporter: Chinmay Kolhatkar
>            Assignee: Chinmay Kolhatkar
>
> Add transform operator
> Details to be added soon once the mailing thread reaching conclusion:
> http://mail-archives.apache.org/mod_mbox/incubator-apex-dev/201603.mbox/%3CCABAipVZUdRGx5dS35bYPN46koLQU5gSLgbCeRH8aM_y9ANRU2w%40mail.gmail.com%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message