void () { final MatchVariableConstraint constraint = new MatchVariableConstraint(); constraint.setName("elephant"); constraint.setNameOfExprType("String"); constraint.setNameOfFormalArgType("String"); final Element test = new Element("constraint"); constraint.writeExternal(test); assertEquals("<constraint name=\"elephant\" nameOfExprType=\"String\" nameOfFormalType=\"String\" within=\"\" contains=\"\" />", JDOMUtil.writeElement(test)); }