public void testCdCommand() throws Exception
{
// go to root
params.clear();
GetItemCommand getItemCommand1 = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
params.add("/");
ctx.put(PARAMETERS_KEY, params);
getItemCommand1.execute(ctx);
// test absPath
params.clear();
GetItemCommand getItemCommandAbsPath = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
params.add("/testJCRClientCommands");
ctx.put(PARAMETERS_KEY, params);
getItemCommandAbsPath.execute(ctx);
assertEquals(ctx.getCurrentItem().getName(), "testJCRClientCommands");
// go to root again
params.clear();
GetItemCommand getItemCommand2 = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
params.add("/");
ctx.put(PARAMETERS_KEY, params);
getItemCommand2.execute(ctx);
// test relPath
params.clear();
GetItemCommand getItemCommandRelPath = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
params.add("testJCRClientCommands");
ctx.put(PARAMETERS_KEY, params);
getItemCommandRelPath.execute(ctx);
assertEquals(ctx.getCurrentItem().getName(), "testJCRClientCommands");
}