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

    https://github.com/apache/flink/pull/1046#discussion_r37976623
  
    --- Diff: 
flink-contrib/flink-storm-compatibility/flink-storm-compatibility-core/src/test/java/org/apache/flink/stormcompatibility/wrappers/StormSpoutWrapperTest.java
 ---
    @@ -52,6 +77,38 @@ public void testRunExecuteCancelInfinite() throws 
Exception {
        }
     
        @Test
    +   public void testOpen() throws Exception {
    +           final IRichSpout spout = mock(IRichSpout.class);
    +           final StormSpoutWrapper<Tuple1<Integer>> spoutWrapper = new 
StormSpoutWrapper<Tuple1<Integer>>(spout);
    +
    +           Map stormConf = new HashMap();
    +           stormConf.put(new String("path"), new 
String("/home/user/file.txt"));
    +           stormConf.put(1, 1024);
    +           Configuration jobConfiguration = new Configuration();
    +           jobConfiguration.putStormConf(stormConf);
    +           Environment env = new RuntimeEnvironment(new JobID(), new 
JobVertexID(), new ExecutionAttemptID(),
    +                           new String(), new String(), 1, 2, 
jobConfiguration, mock(Configuration.class), mock(ClassLoader.class),
    +                           mock(MemoryManager.class), 
mock(IOManager.class), mock(BroadcastVariableManager.class),
    +                           mock(AccumulatorRegistry.class), 
mock(InputSplitProvider.class), mock(Map.class),
    +                           new ResultPartitionWriter[1], new InputGate[1], 
mock(ActorGateway.class),
    +                           mock(TaskManagerRuntimeInfo.class));
    +           StreamingRuntimeContext runtimeContext = new 
StreamingRuntimeContext(env, new ExecutionConfig(),
    +                           mock(KeySelector.class),
    +                           mock(StateHandleProvider.class), 
mock(Map.class));
    +
    +           spoutWrapper.setRuntimeContext(runtimeContext);
    +           spoutWrapper.open(mock(Configuration.class));
    +           final SourceFunction.SourceContext ctx = 
mock(SourceFunction.SourceContext.class);
    +           spoutWrapper.cancel();
    +           spoutWrapper.run(ctx);
    +
    +           Map mapExpect = new HashMap();
    +           mapExpect.put(new String("path"), new 
String("/home/user/file.txt"));
    +           mapExpect.put(1, 1024);
    +           verify(spout).open(eq(mapExpect), any(TopologyContext.class), 
any(SpoutOutputCollector.class));
    --- End diff --
    
    Use `stormConf` instead of `mapExpect`


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