implement the test case testExecuteCommand

Also move the testObject inside