// libsbml deepCopy() == JSBML clone()
@SuppressWarnings("deprecation")
@Test
public void test_ASTNode_deepCopy_1()
{
ASTNode node = new ASTNode();
ASTNode child,copy;
node.setCharacter( '+');
node.addChild(new ASTNode());
node.addChild(new ASTNode());
node.getLeftChild().setValue(1);
node.getRightChild().setValue(2);
assertTrue( node.getType() == ASTNode.Type.PLUS );
assertTrue( node.getCharacter() == '+' );
assertTrue( node.getNumChildren() == 2 );
child = node.getLeftChild();
assertTrue( child.getType() == ASTNode.Type.INTEGER );
assertTrue( child.getInteger() == 1 );
assertTrue( child.getNumChildren() == 0 );
child = node.getRightChild();
assertTrue( child.getType() == ASTNode.Type.INTEGER );
assertTrue( child.getInteger() == 2 );
assertTrue( child.getNumChildren() == 0 );
copy = node.clone();
assertTrue( copy.equals(node) ); // libsbml would say that they are not equals
assertTrue( copy.getType() == ASTNode.Type.PLUS );
assertTrue( copy.getCharacter() == '+' );
assertTrue( copy.getNumChildren() == 2 );
child = copy.getLeftChild();
assertTrue( child.equals(node.getLeftChild()) );
assertTrue( child.getType() == ASTNode.Type.INTEGER );
assertTrue( child.getInteger() == 1 );
assertTrue( child.getNumChildren() == 0 );
child = copy.getRightChild();
assertTrue( child.equals(node.getRightChild()) );
assertTrue( child.getType() == ASTNode.Type.INTEGER );
assertTrue( child.getInteger() == 2 );
assertTrue( child.getNumChildren() == 0 );
node = null;
copy = null;
}