@Test public void testParseNodeShouldReturnWithACompositeConditionWhenConditionNodeArgumentHasOneChildWithNotTagName() { given(node.getChildNodes()).willReturn(nodeList); given(nodeList.getLength()).willReturn(1); given(nodeList.item(0)).willReturn(paramElement); given(paramElement.getNodeType()).willReturn(Node.ELEMENT_NODE); given(paramElement.getTagName()).willReturn(TAGNAME_NOT); given(paramElement.getChildNodes()).willReturn(new MyNodeList(new ArrayList<Node>())); ConditionDescriptor actual = underTest.parseNode(node, document); CompositeCondition actCondition = (CompositeCondition) actual.getCondition(); Assert.assertEquals(actCondition.getConditionType(), ConditionType.NOT); }
@Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); } }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }  }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }  @Override ConditionDescriptor parseNode(final Node conDes, final Document document); }
ConditionDescriptorParser implements NodeParser<ConditionDescriptor> { @Override public ConditionDescriptor parseNode(final Node conDes, final Document document) { int depth = 0; Condition condition = null; if (conDes != null) { Element el = (Element) conDes; List<Condition> parsedConditions = parseConditions(el.getChildNodes(), document, depth); if (!parsedConditions.isEmpty()) { condition = parsedConditions.get(0); } } return new ConditionDescriptor(condition); }  @Override ConditionDescriptor parseNode(final Node conDes, final Document document);  }