Examples of CmdSyst


Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));
      assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(new CmdSyst()));

      String fileName = "/production/resr_test_file.txt";
      assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

      byte[] data = getBytes("DATABYTES");
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

            CmdPass cmdPass = new CmdPass(FtpTestConfig.USER_PASS);
            assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(cmdPass));
         }

         {
            CmdSyst cmdSyst = new CmdSyst();
            assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(cmdSyst));
         }

         {
            CmdCwd cmdCwd = new CmdCwd(FtpTestConfig.TEST_FOLDER);
            if (FtpConst.Replyes.REPLY_550 == client.executeCommand(cmdCwd))
            {
               CmdMkd cmdMkd = new CmdMkd(FtpTestConfig.TEST_FOLDER);
               assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdMkd));

               cmdCwd = new CmdCwd(FtpTestConfig.TEST_FOLDER);
               assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(cmdCwd));
            }

            for (int i1 = 0; i1 < 10; i1++)
            {

               String folderName = FtpTestConfig.TEST_FOLDER + "/" + i1;
               assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(new CmdMkd(folderName)));

               for (int i2 = 0; i2 < 10; i2++)
               {
                  String testSubFolder = folderName + "/" + i2;
                  assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(new CmdMkd(testSubFolder)));
               }

            }
         }

         client.close();
      }

      HashMap<Integer, TestAgent> clients = new HashMap<Integer, TestAgent>();
      int count = 0;

      Random random = new Random();

      while (count < FtpTestConfig.CLIENTS_COUNT)
      {
         int nextId = random.nextInt(Integer.MAX_VALUE);
         log.info("NEXT ID: [" + nextId + "]");

         if (nextId < 10000)
         {
            continue;
         }

         Integer curInteger = new Integer(nextId);
         if (clients.containsKey(curInteger))
         {
            continue;
         }

         TestAgent testAgent = new TestAgent(curInteger, FtpTestConfig.CLIENT_DEPTH);
         clients.put(curInteger, testAgent);
         count++;
      }

      log.info("CLIENTS: [" + clients.size() + "]");

      Thread.sleep(3000);
      log.info("START ALL!!!!!!!!!!!!!!!!!!!!!!!!");
      IsNeedWaitAll = false;
      Thread.sleep(3000);

      {
         boolean alive = true;

         while (alive)
         {
            alive = false;
            Thread.sleep(2000);

            int live = 0;

            Iterator<Integer> keyIter = clients.keySet().iterator();
            while (keyIter.hasNext())
            {
               Integer agentKey = keyIter.next();
               TestAgent agent = clients.get(agentKey);
               if (agent.isAlive())
               {
                  alive = true;
                  live++;
               }
            }

            log.info(">>>>>>>>>>>>> LIVE: [" + live + "]");

         }
      }

      {
         {
            FtpClientSession client = new FtpClientSessionImpl(FtpTestConfig.FTP_HOST, FtpTestConfig.FTP_PORT);
            client.connect();

            {
               CmdUser cmdUser = new CmdUser(FtpTestConfig.USER_ID);
               assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(cmdUser));
            }

            {
               CmdPass cmdPass = new CmdPass(FtpTestConfig.USER_PASS);
               assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(cmdPass));
            }

            {
               CmdSyst cmdSyst = new CmdSyst();
               assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(cmdSyst));
            }

            assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdDele(FtpTestConfig.TEST_FOLDER)));
         }
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

            }

            Thread.sleep(SLEEP);

            {
               CmdSyst cmdSyst = new CmdSyst();
               assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(cmdSyst));
            }

            Thread.sleep(SLEEP);
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

            client.connect();

            assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser(FtpTestConfig.USER_ID)));
            assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass(FtpTestConfig.USER_PASS)));

            assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(new CmdSyst()));
            assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(new CmdType("A")));

            assertEquals(FtpConst.Replyes.REPLY_227, client.executeCommand(new CmdPasv()));

            log.info("Verify folder exists...");
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

            client.connect();

            assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
            assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));

            assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(new CmdSyst()));
            assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(new CmdType("A")));

            for (int i1 = 1; i1 <= ITEMS_COUNT; i1++)
            {
               String folder1 = rootTestFolder + "/folder_" + i1;
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

            client.connect();

            assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
            assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));

            assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(new CmdSyst()));
            assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(new CmdType("A")));

            for (int i1 = 1; i1 <= ITEMS_COUNT; i1++)
            {
               String folder1 = rootTestFolder + "/folder_" + i1;
View Full Code Here

Examples of org.exoplatform.frameworks.ftpclient.commands.CmdSyst

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      {
         CmdSyst cmdSyst = new CmdSyst();
         assertEquals(FtpConst.Replyes.REPLY_530, client.executeCommand(cmdSyst));
      }

      {
         CmdUser cmdUser = new CmdUser(FtpTestConfig.USER_ID);
         assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(cmdUser));
      }

      {
         CmdPass cmdPass = new CmdPass(FtpTestConfig.USER_PASS);
         assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(cmdPass));
      }

      {
         CmdSyst cmdSyst = new CmdSyst();
         assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(cmdSyst));
      }

      client.close();
      log.info("Complete.\r\n");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.