@@ -109,6 +109,30 @@ public void testRunModuleMap() throws ModuleException, InterruptedException,
109109 assertEquals (expectedResult (), m .getOutput ("result" ));
110110 }
111111
112+ /**
113+ * Tests that {@link ModuleService#run(ModuleInfo, boolean, Object...)} and
114+ * {@link ModuleService#run(Module, boolean, Object...)} intelligently handle
115+ * a single-element {@link Object} array consisting of a {@code Map<String,
116+ * Object>}.
117+ * <p>
118+ * This situation can happen e.g. due to Jython choosing the wrong overloaded
119+ * {@code run} method. We correct for the issue on our side, for convenience.
120+ * </p>
121+ */
122+ @ Test
123+ public void testRunMapHack () throws ModuleException , InterruptedException ,
124+ ExecutionException
125+ {
126+ final ModuleInfo info = new FooModuleInfo ();
127+ final Object [] inputs = new Object [] { createInputMap () };
128+ final Module m = moduleService .run (info , false , inputs ).get ();
129+ assertEquals (expectedResult (), m .getOutput ("result" ));
130+
131+ final Module module = info .createModule ();
132+ final Module m2 = moduleService .run (module , false , inputs ).get ();
133+ assertEquals (expectedResult (), m2 .getOutput ("result" ));
134+ }
135+
112136 @ Test
113137 public void testGetSingleInput () throws ModuleException {
114138 final ModuleInfo info = new FooModuleInfo ();
0 commit comments