apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhupeshchawda <...@git.apache.org>
Subject [GitHub] incubator-apex-malhar pull request: APEXMALHAR-1966: Update casand...
Date Wed, 06 Apr 2016 13:51:38 GMT
Github user bhupeshchawda commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-malhar/pull/227#discussion_r58708006
  
    --- Diff: contrib/src/test/java/com/datatorrent/contrib/cassandra/CassandraOperatorTest.java
---
    @@ -269,15 +269,38 @@ public void testCassandraOutputOperator()
         fieldInfos.add(new FieldInfo("set1", "set1", null));
         fieldInfos.add(new FieldInfo("test", "test", null));
     
    -    outputOperator.setStore(transactionalStore);
         outputOperator.setFieldInfos(fieldInfos);
    +    outputOperator.input.setup(tpc);
         outputOperator.setup(context);
    +    outputOperator.activate(context);
     
    -    Attribute.AttributeMap.DefaultAttributeMap portAttributes = new Attribute.AttributeMap.DefaultAttributeMap();
    -    portAttributes.put(Context.PortContext.TUPLE_CLASS, TestPojo.class);
    -    TestPortContext tpc = new TestPortContext(portAttributes);
    +    List<TestPojo> events = Lists.newArrayList();
    +    for (int i = 0; i < 3; i++) {
    +      Set<Integer> set = new HashSet<Integer>();
    +      set.add(i);
    +      List<Integer> list = new ArrayList<Integer>();
    +      list.add(i);
    +      Map<String, Integer> map = new HashMap<String, Integer>();
    +      map.put("key" + i, i);
    +      events.add(new TestPojo(UUID.randomUUID(), i, "abclast", true, i, 2.0, set, list,
map, new Date(System.currentTimeMillis())));
    +    }
    +
    +    outputOperator.beginWindow(0);
    +    for (TestPojo event : events) {
    +      outputOperator.input.process(event);
    +    }
    +    outputOperator.endWindow();
    +
    +    Assert.assertEquals("rows in db", 3, outputOperator.getNumOfEventsInStore());
    +    outputOperator.getEventsInStore();
    +  }
     
    +  @Test
    +  public void testPopulateFieldInfo()
    +  {
    +    TestOutputOperator outputOperator = setupForOutputOperatorTest();
         outputOperator.input.setup(tpc);
    +    outputOperator.setup(context);
    --- End diff --
    
    Check order of setup for input port and operator


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

Mime
View raw message