Package org.exoplatform.frameworks.jcr.cli

Examples of org.exoplatform.frameworks.jcr.cli.GetItemCommand


   public void testGetCtxItem() throws Exception
   {

      params.clear();
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("/testJCRClientCommands");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);
      System.out.println("[out]:" + ctx.getOutput());
      assertEquals(ctx.getCurrentItem().getName(), "testJCRClientCommands");
   }
View Full Code Here


   public void testGetCtxNodes() throws Exception
   {
      System.out.println("=== ls ===");
      params.clear();
      // current item is Property, need to go to Node
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("/testJCRClientCommands");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);
      // ok, now currentItem is Node "/testJCRClientCommands"
      GetNodesCommand getNodesCommand = (GetNodesCommand)cservice.getCatalog("CLI").getCommand("getnodes");
      getNodesCommand.execute(ctx);
      System.out.println("[out]:" + ctx.getOutput());
      assertTrue(ctx.getOutput().contains("childOftestJCRClientCommands"));
View Full Code Here

   public void testSetProperty2() throws Exception
   {
      params.clear();
      //
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("..");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);
      //
      params.clear();
      SetPropertyCommand setPropertyCommand = (SetPropertyCommand)cservice.getCatalog("CLI").getCommand("setproperty");
      params.add("propertyName2");
      params.add("12345");
View Full Code Here

   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");
   }
View Full Code Here

   public void testGetCtxItem() throws Exception
   {

      params.clear();
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("/testJCRClientCommands");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);

      assertEquals(ctx.getCurrentItem().getName(), "testJCRClientCommands");
   }
View Full Code Here

   public void testGetCtxNodes() throws Exception
   {
      params.clear();
      // current item is Property, need to go to Node
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("/testJCRClientCommands");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);
      // ok, now currentItem is Node "/testJCRClientCommands"
      GetNodesCommand getNodesCommand = (GetNodesCommand)cservice.getCatalog("CLI").getCommand("getnodes");
      getNodesCommand.execute(ctx);

      assertTrue(ctx.getOutput().contains("childOftestJCRClientCommands"));
View Full Code Here

   public void testSetProperty2() throws Exception
   {
      params.clear();
      //
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("..");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);
      //
      params.clear();
      SetPropertyCommand setPropertyCommand = (SetPropertyCommand)cservice.getCatalog("CLI").getCommand("setproperty");
      params.add("propertyName2");
      params.add("12345");
View Full Code Here

   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");
   }
View Full Code Here

   public void testGetCtxItem() throws Exception
   {

      params.clear();
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("/testJCRClientCommands");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);

      assertEquals(ctx.getCurrentItem().getName(), "testJCRClientCommands");
   }
View Full Code Here

   public void testGetCtxNodes() throws Exception
   {
      params.clear();
      // current item is Property, need to go to Node
      GetItemCommand getItemCommand = (GetItemCommand)cservice.getCatalog("CLI").getCommand("getitem");
      params.add("/testJCRClientCommands");
      ctx.put(PARAMETERS_KEY, params);
      getItemCommand.execute(ctx);
      // ok, now currentItem is Node "/testJCRClientCommands"
      GetNodesCommand getNodesCommand = (GetNodesCommand)cservice.getCatalog("CLI").getCommand("getnodes");
      getNodesCommand.execute(ctx);

      assertTrue(ctx.getOutput().contains("childOftestJCRClientCommands"));
View Full Code Here

TOP

Related Classes of org.exoplatform.frameworks.jcr.cli.GetItemCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.