@Test public void compare() { ChoiceNode p1 = new ChoiceNode("name", "value"); ChoiceNode p2 = new ChoiceNode("name", "value"); List<ChoiceNode> td1 = new ArrayList<ChoiceNode>(); td1.add(p1); List<ChoiceNode> td2 = new ArrayList<ChoiceNode>(); td2.add(p2); List<ChoiceNode> td3 = new ArrayList<ChoiceNode>(); TestCaseNode tc1 = new TestCaseNode("name", td1); TestCaseNode tc2 = new TestCaseNode("name", td2); TestCaseNode tc3 = new TestCaseNode("name", td3); assertTrue(tc1.isMatch(tc2)); assertFalse(tc1.isMatch(tc3)); tc1.setName("tc1"); assertFalse(tc1.isMatch(tc2)); tc2.setName("tc1"); assertTrue(tc1.isMatch(tc2)); p1.setName("p1"); assertFalse(tc1.isMatch(tc2)); p2.setName("p1"); assertTrue(tc1.isMatch(tc2)); }
@Override public Object visit(ChoiceNode node) throws Exception { List<Image> decorations = new ArrayList<Image>(); decorations.add(implementationStatusDecoration(node)); if (node.isAbstract()) { decorations.add(getImageFromFile("abstract.png")); } return decorations; }
@Override public Object visit(ChoiceNode node) throws Exception { return node.toString(); }