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

    https://github.com/apache/flink/pull/1591#discussion_r52102056
  
    --- Diff: 
flink-contrib/flink-storm/src/test/java/org/apache/flink/storm/wrappers/SpoutCollectorTest.java
 ---
    @@ -75,12 +75,71 @@ public void testSpoutStormCollector() throws 
InstantiationException, IllegalAcce
                }
        }
     
    +   @SuppressWarnings({ "rawtypes", "unchecked" })
    +   @Test
    +   public void testSpoutStormCollectorWithTaskId() throws 
InstantiationException, IllegalAccessException {
    +           for (int numberOfAttributes = 0; numberOfAttributes < 25; 
++numberOfAttributes) {
    +                   final SourceContext flinkCollector = 
mock(SourceContext.class);
    +                   final int taskId = 42;
    +                   final String streamId = "streamId";
    +
    +                   HashMap<String, Integer> attributes = new 
HashMap<String, Integer>();
    +                   attributes.put(streamId, numberOfAttributes);
    +
    +                   SpoutCollector<?> collector = new 
SpoutCollector(attributes, taskId, flinkCollector);
    +
    +                   final Values tuple = new Values();
    +                   final Tuple flinkTuple = 
Tuple.getTupleClass(numberOfAttributes + 1).newInstance();
    +
    +                   for (int i = 0; i < numberOfAttributes; ++i) {
    +                           tuple.add(new Integer(this.r.nextInt()));
    +                           flinkTuple.setField(tuple.get(i), i);
    +                   }
    +                   flinkTuple.setField(taskId, numberOfAttributes);
    +
    +                   final List<Integer> taskIds;
    +                   final Object messageId = new Integer(this.r.nextInt());
    +
    +                   taskIds = collector.emit(streamId, tuple, messageId);
    +
    +                   Assert.assertNull(taskIds);
    +
    +                   verify(flinkCollector).collect(flinkTuple);
    +           }
    +   }
    +
    +   @SuppressWarnings("unchecked")
    +   @Test(expected = UnsupportedOperationException.class)
    +   public void testToManyAttributes() {
    --- End diff --
    
    typo


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