Add the test of setPort