Testbeam and laboratory characterization of CMS 3D pixel sensors