Testing metapopulation dynamics using genetic, demographic and ecological data