@Test public void testGo() { Weld w = new Weld(); WeldContainer wc = w.initialize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); CDIInstanceExample bean = wc.instance().select(CDIInstanceExample.class).get(); bean.go(ps); ps.close(); String actual = new String(baos.toByteArray()); String expected = "" + "Dave: Hello, HAL. Do you read me, HAL?" + NL + "HAL: Dave. I read you." + NL; assertEquals(expected, actual); w.shutdown(); }
public void go(PrintStream out) { KieSession ksession = kSession.get(); ksession.setGlobal("out", out); ksession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); ksession.fireAllRules(); }
CDIInstanceExample { public void go(PrintStream out) { KieSession ksession = kSession.get(); ksession.setGlobal("out", out); ksession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); ksession.fireAllRules(); } }
CDIInstanceExample { public void go(PrintStream out) { KieSession ksession = kSession.get(); ksession.setGlobal("out", out); ksession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); ksession.fireAllRules(); }  }
CDIInstanceExample { public void go(PrintStream out) { KieSession ksession = kSession.get(); ksession.setGlobal("out", out); ksession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); ksession.fireAllRules(); }  void go(PrintStream out); static void main(String[] args); }
CDIInstanceExample { public void go(PrintStream out) { KieSession ksession = kSession.get(); ksession.setGlobal("out", out); ksession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); ksession.fireAllRules(); }  void go(PrintStream out); static void main(String[] args);  }