Extract common code in the test package object.