public JPopupMenu makePopup(Obj obj) { JPopupMenu menu = new JPopupMenu(); Op[] ops = (Op[]) obj.list(Op.class); if (ops.length > 0) { JMenu sub = new JMenu("Operations"); sub.setIcon(UiSession.iconOp); for (int i = 0; i < ops.length; ++i) sub.add(new Invoke(ops[i])); menu.add(sub); } if (obj.getHref() != null) menu.add(new Goto(obj.getNormalizedHref())); if (obj instanceof Op) menu.add(new Invoke((Op) obj)); return menu; }
@Test() public void getLobbyWithWrongURIShouldReturnErr() { ObixLobby lobby = undecoratedCoapChannel.getLobby("wrong"); Obj lobbyObj = ObixXmlChannelDecorator.decode(lobby.getLobbyAsString()); Assert.assertTrue(lobbyObj.isErr()); }